avahi-daemon이 "Unable to chroot(): Permission Denied" 메시지와 함께 시작되지 않습니다. 그러나 stderr-IO-redirection 없이만 가능

avahi-daemon이 "Unable to chroot(): Permission Denied" 메시지와 함께 시작되지 않습니다. 그러나 stderr-IO-redirection 없이만 가능

최근 업그레이드 후 avahi-daemon이 더 이상 시작되지 않습니다. 또한 stderr를 파일로 리디렉션하는지 여부에 따라 동작이 다릅니다.

avahi-daemon --debug디버그 옵션( )을 사용하여 avahi를 실행 하면 다음과 같은 출력이 표시됩니다.

Found user 'avahi' (UID 84) and group 'avahi' (GID 84).
Successfully dropped root privileges.
avahi-daemon 0.6.32 starting up.
Failed to chroot(): Permission denied
chroot.c: chroot() helper started
chroot.c: chroot() helper got command 0d
avahi-daemon 0.6.32 exiting.
chroot.c: chroot() helper got command 0c
chroot.c: chroot() helper exiting with return value 0

stderr IO 리디렉션()을 추가하면 avahi-daemon --debug 2>avahi.stderr다른 동작이 발생합니다.

터미널( stdout)에서 나는 얻는다.

File size limit exceeded

이제 avahi.stderr포함

Found user 'avahi' (UID 84) and group 'avahi' (GID 84).
Successfully dropped root privileges.

그러나 avahi 프로세스가 실행되고 있지 않습니다.

리디렉션만 하면 2>/dev/stdin리디렉션이 없을 때와 동일한 동작이 발생합니다.

해당 strace 출력:

strace avahi-daemon --debug:

stackexchange 크기 제한으로 인해 이는 Pastebin에 있습니다. http://paste.pound-python.org/show/J1sYeeXcKYKlHxN6QAX0/

strace avahi-daemon --debug 2>strace.out( File size limit exceeded표준 출력에서):

스택 교환 크기 제한으로 인해 이 파일은 Pastebin에 있습니다. http://paste.pound-python.org/show/VpFokjSr6kmNAA98s4Y6/

내 환경( env루트가 아닌 사용자 이름이 검열된 출력)은 다음과 같습니다.

stackexchange 크기 제한으로 인해 이는 Pastebin에 있습니다. http://paste.pound-python.org/show/3s9Qo1WVMB6mLtf15pXp/

avahi 버전: avahi-daemon -V인쇄 avahi-daemon 0.6.32.

구성 정보:

% ls -la /etc | grep avahi
drwx------   3 root     root       4096 Mar  9 13:29 avahi

% ls -la /etc/avahi
drwx------   3 root root  4096 Mar  9 13:29 .
drwxr-xr-x 242 root root 20480 Mar  9 13:29 ..
-rwxr-xr-x   1 root root  2509 Feb 19 13:52 avahi-autoipd.action
-rw-r--r--   1 root root  1747 Feb 19 13:52 avahi-daemon.conf
-rw-r--r--   1 root root  1747 Dec 25 18:22 avahi-daemon.conf.pacnew
lrwxrwxrwx   1 root root    38 Mar  9 13:25 avahi-daemon.conf.pacsave -> /usr/local/etc/avahi/avahi-daemon.conf
-rwxr-xr-x   1 root root  2743 Feb 19 13:52 avahi-dnsconfd.action
-rw-r--r--   1 root root  1121 Feb 19 13:52 hosts
drwx------   2 root root  4096 Mar  9 13:29 services

/usr/local/etc/avahi/avahi-daemon.conf제가 평소에 사용하던 구성인데, 업데이트하면서 바뀌었습니다. 해당 구성을 사용하면 동일한 동작이 발생하며 /etc/avahi/avahi-daemon.conf내부 일반 파일인지 심볼릭 링크인지는 중요하지 않습니다.

/etc/avahi/avahi-daemon.conf여기에 이 ​​질문을 만든 내용을 게시합니다.

# This file is part of avahi.
#
# avahi is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# avahi is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with avahi; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.

# See avahi-daemon.conf(5) for more information on this configuration
# file!

[server]
#host-name=foo
#domain-name=local
#browse-domains=0pointer.de, zeroconf.org
use-ipv4=yes
use-ipv6=yes
#allow-interfaces=eth0
#deny-interfaces=eth1
#check-response-ttl=no
#use-iff-running=no
#enable-dbus=yes
#disallow-other-stacks=no
#allow-point-to-point=no
#cache-entries-max=4096
#clients-max=4096
#objects-per-client-max=1024
#entries-per-entry-group-max=32
ratelimit-interval-usec=1000000
ratelimit-burst=1000

[wide-area]
enable-wide-area=yes

[publish]
#disable-publishing=no
#disable-user-service-publishing=no
#add-service-cookie=no
#publish-addresses=yes
publish-hinfo=no
publish-workstation=no
#publish-domain=yes
#publish-dns-servers=192.168.50.1, 192.168.50.2
#publish-resolv-conf-dns-servers=yes
#publish-aaaa-on-ipv4=yes
#publish-a-on-ipv6=no

[reflector]
#enable-reflector=no
#reflect-ipv=no

[rlimits]
#rlimit-as=
rlimit-core=0
rlimit-data=4194304
rlimit-fsize=0
rlimit-nofile=768
rlimit-stack=4194304
rlimit-nproc=3

저는 패키지 사용 여부에 관계없이 OpenRC(즉, systemd 없음)와 함께 Arch Linux를 사용하고 있습니다 avahi. avahi-nosystemd이전에 avahi가 실행되었다가 충돌하는 등 몇 가지 문제가 있었습니다.

여기서 무슨 일이 일어날 수 있습니까?

답변1

해결책:

/etc/avahi/avahi-daemon액세스하려면 루트 권한을 제거해야 합니다.

따라서 /etc/avahi/모든 하위 디렉터리에는 모드가 있어야 하며 , 모든 파일은 여전히 ​​사용자와 그룹이 소유하고 있는 755동안 모드를 가져야 합니다 .644rootroot

답변2

언급된 또 다른 문제와 관련하여 avahi-daemon의 구성에서 파일 크기 rlimit가 0으로 설정되어 있고 파일로 리디렉션하면 파일 크기가 0보다 큰 파일이 생성되기 때문에 avahi-daemon에서 "파일 크기 제한 초과" 오류가 발생합니다.

이 기능을 비활성화하려면 avahi 구성에서 rlimit-fsize=0을 주석 처리하세요.

[rlimits]
#rlimit-as=
rlimit-core=0
rlimit-data=4194304
#rlimit-fsize=0

관련 정보