Bug 296970 - net/avahi-app: rc.d script requires administrator to start dbus manually before avahi-daemon if the former is not already started
Summary: net/avahi-app: rc.d script requires administrator to start dbus manually befo...
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-desktop (Team)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-07-21 21:49 UTC by Enji Cooper
Modified: 2026-07-26 17:07 UTC (History)
2 users (show)

See Also:
arrowd: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Enji Cooper freebsd_committer freebsd_triage 2026-07-21 21:49:34 UTC
Procedure:

- Run `pkg install -y avahi-app` as root.
- Add the following lines to /etc/rc.conf:
```
avahi_enable="YES"
dbus_enable="YES"
```
- Run `service avahi-daemon restart` as root.

Actual results:

avahi-daemon terminates at startup with a message about not being able to connect to the dbus listening socket.

Expected results:

`avahi-daemon` should start its dependencies (in this case dbus) as needed, like many other services do.

Other thoughts:

Adding `force_depend dbus || return 1` to the precmd would be the right way to achieve what I described above using the existing rc.d framework.
Comment 1 Gleb Popov freebsd_committer freebsd_triage 2026-07-22 06:50:48 UTC
(In reply to Enji Cooper from comment #0)
> Actual results:
> avahi-daemon terminates at startup with a message about not being able to connect to the dbus listening socket.

I fail to reproduce this. Everything's working for me.

> Adding `force_depend dbus || return 1` to the precmd would be the right way to achieve what I described above using the existing rc.d framework.

How's so? Isn't "REQUIRE: dbus" enough?
Comment 2 Enji Cooper freebsd_committer freebsd_triage 2026-07-25 16:23:15 UTC
(In reply to Gleb Popov from comment #1)

> I fail to reproduce this. Everything's working for me.

The problem occurs if dbus is not already running. I should have added that note to the repro :/.

> How's so? Isn't "REQUIRE: dbus" enough?

That handles the init(1) starting services at boot case. That doesn't handle the case where someone tries installing avahi-app without dbus first running, then trying to start avahi.
Comment 3 Gleb Popov freebsd_committer freebsd_triage 2026-07-25 17:45:07 UTC
This is a generic "a service requires another service" problem. We should either do nothing about that or solve it in a generic way. There is nothing special about dbus and avahi.

Both Bapt and me came to idea of enabling rc.d services automatically on a package install. It is not yet implemented and it is up to user whether to enable it. Having this feature disabled (like it is now effectively) means that the user is expected to enable services manually.

(In reply to Enji Cooper from comment #2)
> `avahi-daemon` should start its dependencies (in this case dbus) as needed, like many other services do.

What services do this?
Comment 4 Enji Cooper freebsd_committer freebsd_triage 2026-07-26 16:47:21 UTC
(In reply to Gleb Popov from comment #3)

> Both Bapt and me came to idea of enabling rc.d services automatically on a package install. It is not yet implemented and it is up to user whether to enable it. Having this feature disabled (like it is now effectively) means that the user is expected to enable services manually.

This seems like it would have undesirable security implications for sysadmins operating unattended package upgrades.

> What other services do this?

I thought net/samba did, but I guess not? We have other components in base that do, like NFS and NIS and there are a limited set of ports that do this as well:

```
% rg force_depend
x11/cde/files/dtcms.in
21:start_precmd="force_depend rpcbind || exit 1"

x11/cde/files/dtcms25.in
21:start_precmd="force_depend rpcbind || exit 1"

x11/cde-devel/files/dtcms-devel.in
21:start_precmd="force_depend rpcbind || exit 1"

x11/cde-devel/files/dtcms.in
21:start_precmd="force_depend rpcbind || exit 1"

sysutils/am-utils/files/amd.in
24:     force_depend nfsclient nfs_client || return 1
25:     force_depend rpcbind || return 1
```
Comment 5 Enji Cooper freebsd_committer freebsd_triage 2026-07-26 16:49:35 UTC
(In reply to Enji Cooper from comment #4)

I might also be accidentally conflating UX with other OSes like Fedora and Ubuntu Linux.. so much of this stuff tends to blend together after a while. So, this might ultimately be a feature request not unique to this port.

If the new rc.d daemon bapt@ is working on resolves this more cleanly, that would be nice.
Comment 6 Gleb Popov freebsd_committer freebsd_triage 2026-07-26 17:07:26 UTC
(In reply to Enji Cooper from comment #4)
> This seems like it would have undesirable security implications for sysadmins operating unattended package upgrades.

It is a matter of the chosen default for this feature, which I hope would be opt-in rather than enabled by default.