Opened 6 years ago

Closed 21 months ago

Last modified 21 months ago

#57519 closed defect (fixed)

avahi @0.7_3+gtk+gtk3+quartz: daemon fails to start (with error)

Reported by: rbubley Owned by: briankendall (Brian Kendall)
Priority: Normal Milestone:
Component: ports Version: 2.5.2
Keywords: Cc:
Port: avahi

Description

Starting avahi-daemon gives an error message.

In logs (repeatedly):

Nov  6 09:31:03 <REDACTED> com.apple.xpc.launchd[1] (org.freedesktop.avahi-daemon[34061]): Service exited with abnormal code: 255
Nov  6 09:31:03 <REDACTED> com.apple.xpc.launchd[1] (org.freedesktop.avahi-daemon): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.

From the command line:

/ $ sudo /opt/local/sbin/avahi-daemon
mkdir("/run/avahi-daemon/"): No such file or directory

Change History (6)

comment:1 Changed 6 years ago by kencu (Ken)

I have this issue also, and so far have not sorted out how to fix it.

comment:2 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Confirmed, and configure output shows:

    avahi socket:                              /run/avahi-daemon/socket

That's clearly not what we want and we need to fix that somehow. The configure script says:

#
# Avahi runtime dir
#
avahi_runtime_dir="/run"
avahi_socket="${avahi_runtime_dir}/avahi-daemon/socket"

So we need to somehow change avahi_runtime_dir from /run to ${prefix}/var/run. Not sure if there's an exposed configure flag for that or if we need to patch the configure script.

I also wonder if we're supposed to be creating that directory in the portfile and setting its ownership to the avahi user.

comment:3 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

An upstream change caused this. It has been requested that this upstream change be changed or reverted.

comment:4 Changed 21 months ago by briankendall (Brian Kendall)

I just spent several hours digging into this, and was finally able to get avahi to launch. The two issues that needed to be fixed were the aforementioned issue with /run for which I added a patch to configure, and that avahi will terminate if it's launched by launchd and drops root via setuid after launching. I submitted a PR here: https://github.com/macports/macports-ports/pull/17690

comment:5 Changed 21 months ago by briankendall (Brian Kendall)

Owner: set to briankendall
Resolution: fixed
Status: newclosed

In f3a1ca4ae4513050b2899e1e966fc59dd7af8f93/macports-ports (master):

avahi: fix daemon start failure

  • patches configure so that daemon places socket file in /var/run rather than /run
  • launches daemon with --no-drop-root argument as setuid is explicitly not supported when launched via launchd

Closes: #57519

comment:6 Changed 21 months ago by ryandesign (Ryan Carsten Schmidt)

In e7efde76189b442bbd7d2a48cb9b191cd48afc28/macports-ports (master):

avahi: Fix case of file being patched

Fixes build failure on case-sensitive filesystems e.g. buildbot workers.

See: #57519

Note: See TracTickets for help on using tickets.