Your message dated Sun, 5 Jun 2022 18:32:20 +0200
with message-id <[email protected]>
and subject line Re: avahi-daemon: Failed to open /etc/resolv.conf: Invalid 
argument chroot.c: open() failed: No such file or directory
has caused the Debian Bug report #800643,
regarding avahi-daemon[609]: chroot.c: open() failed: No such file or directory
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
800643: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=800643
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: avahi-daemon
Version: 0.6.32-2
Severity: normal

Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

   * What led up to the situation?
Boot the  PC
   * What exactly did you do (or not do) that was effective (or
     ineffective)?
Look for errors in journalctl
   * What was the outcome of this action?

Aug 20 09:51:48 debian avahi-daemon[609]: chroot.c: open() failed: No such file
or directory
Aug 20 09:51:48 debian avahi-daemon[569]: Failed to open /etc/resolv.conf:
Invalid argument
Aug 20 09:51:48 debian avahi-daemon[569]: No service file found in
/etc/avahi/services.

   * What outcome did you expect instead?
No errors

***
avahi-daemon starts too early, that is before the network resources are
available.
I modify the service addind a condition After=network-online.target

[Unit]
Description=Avahi mDNS/DNS-SD Stack
After=network-online.target

[Service]
Type=dbus
BusName=org.freedesktop.Avahi
ExecStart=/usr/sbin/avahi-daemon -s
ExecReload=/usr/sbin/avahi-daemon -r
NotifyAccess=main

[Install]
WantedBy=multi-user.target
Also=avahi-daemon.socket
Alias=dbus-org.freedesktop.Avahi.service

Result is now better
systemctl status avahi-daemon
● avahi-daemon.service - Avahi mDNS/DNS-SD Stack
   Loaded: loaded (/lib/systemd/system/avahi-daemon.service; enabled; vendor
preset: enabled)
   Active: active (running) since Sun 2017-08-20 10:04:33 CEST; 12min ago
 Main PID: 712 (avahi-daemon)
   Status: "avahi-daemon 0.6.32 starting up."
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/avahi-daemon.service
           ├─712 avahi-daemon: running [debian.local]
           └─740 avahi-daemon: chroot helper

août 20 10:04:32 debian avahi-daemon[712]: avahi-daemon 0.6.32 starting up.
août 20 10:04:33 debian systemd[1]: Started Avahi mDNS/DNS-SD Stack.
août 20 10:04:33 debian avahi-daemon[712]: Successfully called chroot().
août 20 10:04:33 debian avahi-daemon[712]: Successfully dropped remaining
capabilities.
août 20 10:04:33 debian avahi-daemon[712]: No service file found in
/etc/avahi/services.
août 20 10:04:33 debian avahi-daemon[712]: Joining mDNS multicast group on
interface wlan0.IPv4 with address 192.168.1.6
août 20 10:04:33 debian avahi-daemon[712]: New relevant interface wlan0.IPv4
for mDNS.
août 20 10:04:33 debian avahi-daemon[712]: Network interface enumeration
completed.
août 20 10:04:33 debian avahi-daemon[712]: Registering new address record for
192.168.1.68 on wlan0.IPv4.
août 20 10:04:33 debian avahi-daemon[712]: Server startup complete. Host name
is debian.local. Local service cookie is 3



after

systemctl status network-online.target
● network-online.target - Network is Online
   Loaded: loaded (/lib/systemd/system/network-online.target; static; vendor
preset: enabled)
   Active: active since Sun 2017-08-20 10:04:32 CEST; 15min ago
     Docs: man:systemd.special(7)
           https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget

août 20 10:04:32 debian systemd[1]: Reached target Network is Online.



-- System Information:
Debian Release: buster/sid
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable'), (500, 'oldstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.9.0-3-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), 
LANGUAGE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages avahi-daemon depends on:
ii  adduser              3.116
ii  bind9-host [host]    1:9.10.3.dfsg.P4-12.5
ii  dbus                 1.11.16+really1.10.22-1
ii  host                 1:9.10.3.dfsg.P4-12.5
ii  init-system-helpers  1.49
ii  libavahi-common3     0.6.32-2
ii  libavahi-core7       0.6.32-2
ii  libc6                2.24-14
ii  libcap2              1:2.25-1
ii  libdaemon0           0.14-6+b1
ii  libdbus-1-3          1.11.16+really1.10.22-1
ii  libexpat1            2.2.3-1
ii  lsb-base             9.20161125

Versions of packages avahi-daemon recommends:
ii  libnss-mdns  0.10-8

Versions of packages avahi-daemon suggests:
ii  avahi-autoipd  0.6.32-2

-- no debconf information

--- End Message ---
--- Begin Message ---
This issue has supposedly been fixed in

https://github.com/systemd/systemd/commit/3e06055500755053050620a45236ef606507e1bd

which is part of systemd v234 and later.

On Thu, 01 Oct 2015 19:31:59 -0700 Erik <[email protected]> wrote:
Package: avahi-daemon
Version: 0.6.31-5
Severity: normal
Tags: patch

avahi-daemon.service produces errors in the journal when used with
systemd-networkd and systemd-resolved. The avahi-daemon cannot open the
/etc/resolv.conf file because it starts before systemd-resolved. Journal
entries are provided below.


Background:

According to `man systemd-resolved,` it is advisable to remove
/etc/resolv.conf and link /etc/resolv.conf to /run/systemd/resolve/resolv.conf. The reason being that systemd-resolved will read nameservers from systemd.network files and populate /run/systemd/resolve/resolv.conf. When avahi-daemon starts before systemd-resolved, the target of the
/etc/resolv.conf link is not present on /run. Therefore,
avahi-daemon.service is dependent on systemd-resolve.


Solution:
Change avahi-daemon's dependency on /etc/resolv.conf and read
/run/systemd/resolve/resolv.conf instead and add a
"After=systemd-resolved.service" to avahi-daemon.service. This also
creates other problems. What about network mounts in /etc/fstab using nfs or
samba? I've also had to put mount options for a cifs mount like
"x-systemd.requires=systemd-networkd-wait-online.service" in /etc/fstab.
When avahi-daemon does not load, name resolution fails, all kinds of
network related services fail. Now everything has to have
"After=systemd-networkd-wait-online" added to their systemd.unit files.
This means the system pauses significantly; i.e. services block.
What else needs to read /etc/resolv.conf? At this time there is no
libnss-resolve (libnss-resolve.so, shipped with systemd) to add a "resolve"
in /etc/nsswitch.conf for systemd-resolved. Everything that depends on
/etc/resolv.conf will also need After=systemd-networkd-wait-online.service lines added to their systemd.unit files too.

Another bug could be filed with systemd since systemd-resolved is there.

Workaround:
# Execute as root
mkdir -p /etc/systemd/system/avahi-daemon.service.d
printf "[Unit]\nAfter = systemd-resolved.service\n" > \
  /etc/systemd/system/avahi-daemon.service.d/ad.conf
systemctl daemon-reload


Journal:

Oct 01 18:41:32 incense avahi-daemon[625]: Successfully dropped root
privileges.
Oct 01 18:41:32 incense avahi-daemon[625]: avahi-daemon 0.6.31 starting
up.
Oct 01 18:41:49 incense avahi-daemon[625]: Successfully called chroot().
Oct 01 18:41:49 incense avahi-daemon[625]: Successfully dropped
remaining capabilities.
Oct 01 18:41:49 incense avahi-daemon[734]: chroot.c: open() failed: No

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


--- End Message ---

Reply via email to