avahi-daemon は "Unable to chroot(): Permission Denied" メッセージで起動しません。ただし、stderr-IO-redirectionなしでのみ可能

avahi-daemon は

最近のアップグレード後、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.outFile size limit exceeded標準出力から):

スタック交換サイズの制限により、このファイルはPastebinにあります。 http://paste.pound-python.org/show/VpFokjSr6kmNAA98s4Y6/

私の環境(envroot以外のユーザー名が検閲された出力)は次のとおりです。

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を使用していますavahiavahi-nosystemd以前にavahiが実行されてクラッシュするなど、いくつかの問題がありました。

ここで何が起こりますか?

ベストアンサー1

解決策:

/etc/avahi/avahi-daemonアクセスするには、root権限を削除する必要があります。

したがって/etc/avahi/、すべてのサブディレクトリにはモードが必要であり、すべてのファイルはまだユーザーとグループが所有している755間モードを持たなければなりません。644rootroot

おすすめ記事