Comments (11)
I assume this has never really been solved, right? To me it seems that avahi's dbus activation is clearly broken. There are two cases to consider:
avahi-daemon.service
has not been enabled via systemd. Then dbus activation viaorg.freedesktop.Avahi.service
cannot work because that file saysSystemdService=dbus-org.freedesktop.Avahi.service
. However, the aliasdbus-org.freedesktop.Avahi.service
is not known to systemd because that symlink is only created whenavahi-daemon.service
is enabled.avahi-daemon.service
has been enabled via systemd. The dbus activation would work because the alias is known. However, it is basically unnecessary becauseavahi-daemon.service
is anyway automatically started at boot up.
So, currently there is no way to have avahi-daemon.service
only be started when requested via dbus.
[2023-09-09 16:11] Quick addition:
systemd uses a very similar pattern for several of its services (hostnamed, timedated, etc.). To make it work, they provide corresponding symlinks next to the service files:
bevan@zenpad ~ % ls -la /usr/lib/systemd/system/dbus*
-rw-r--r-- 1 root root 410 2. Sep 15:42 /usr/lib/systemd/system/dbus.service
-rw-r--r-- 1 root root 102 2. Sep 15:42 /usr/lib/systemd/system/dbus.socket
lrwxrwxrwx 1 root root 25 7. Sep 09:47 /usr/lib/systemd/system/dbus-org.freedesktop.hostname1.service -> systemd-hostnamed.service
lrwxrwxrwx 1 root root 23 7. Sep 09:47 /usr/lib/systemd/system/dbus-org.freedesktop.import1.service -> systemd-importd.service
lrwxrwxrwx 1 root root 23 7. Sep 09:47 /usr/lib/systemd/system/dbus-org.freedesktop.locale1.service -> systemd-localed.service
lrwxrwxrwx 1 root root 22 7. Sep 09:47 /usr/lib/systemd/system/dbus-org.freedesktop.login1.service -> systemd-logind.service
lrwxrwxrwx 1 root root 24 7. Sep 09:47 /usr/lib/systemd/system/dbus-org.freedesktop.machine1.service -> systemd-machined.service
lrwxrwxrwx 1 root root 25 7. Sep 09:47 /usr/lib/systemd/system/dbus-org.freedesktop.portable1.service -> systemd-portabled.service
lrwxrwxrwx 1 root root 25 7. Sep 09:47 /usr/lib/systemd/system/dbus-org.freedesktop.timedate1.service -> systemd-timedated.service
This is just missing for avahi.
from avahi.
According to the following URL:
https://fedoraproject.org/wiki/Packaging:Systemd#DBus_activation
Note that the creation/removal of the alias symlinks should be done with "systemctl enable" and "systemctl disable" only. You should not create these symlinks manually
From reading that I would suggest the "proper" fix is to run systemctl enable during post-install to install the symlink. Thoughts?
Looking at the fedora spec, it seems to do this when upgrading from pre-systemd:
/usr/bin/systemctl --no-reload enable avahi-daemon.service >/dev/null 2>&1 || :
/usr/bin/systemctl try-restart avahi-daemon.service >/dev/null 2>&1 || :
During non upgrades seems they use some rpm mechanism to basically do the same:
%systemd_postun_with_restart avahi-daemon.socket avahi-daemon.service
So I feel like I'm generally correct.. the exact syntax probably depends on the package manager and the 'standard' way of handling this during installation
from avahi.
Well, the problem is how to ensure make install will provide the link as, otherwise, people will simply see in the logs that the service is failing to start because of "No such file or directory" :/
Or maybe it could show a warning at the end (I bit like it's done in some packages for remembering people to run update-mime-database and similar)
from avahi.
I have sent a mail to systemd list, hopefully they will know :)
http://lists.freedesktop.org/archives/systemd-devel/2015-October/034736.html
from avahi.
OK based on the reply you got, the service file that Fedora ships is the same one we ship.. that info is there.
That info is used and actioned by "systemctl enable avahi-daemon", by default it's disabled. I'm fairly sure that is what should be done by "make install" and your distro-specific post-install script should run "systemctl enable" - which is basically the better equivalent to your manual symlink.
I don't think "make install" should run systemctl enable.
from avahi.
Per the following comments in the mailing list, it seems that we should go with the Fedora way of doing it... even if it seems people will need to still manually enable avahi :/
from avahi.
I'm confused as to why your distribution script cannot run this command, to 'automate' the process (nothing manual required). I don't think it makes sense to automate this in "make install" but it makes perfect sense during package installation (depending of course, on the policy if your distribution.. Debian seems to almost always auto-start things, fedora is a bit more so-so about that).
from avahi.
Well, in our case (Gentoo) we support at least two init systems (systemd and openrc), then, we cannot enable it blindly. Even for setups running systemd, we don't think it's ok to automatically enable a service a user would not be aware of. What it's a non sense to me is that, if we don't enable the service to get it running all the time, people will simply get a "no such file or directory" failure when systemd tries to spawn avahi but it cannot do that because of the link being missing :/
from avahi.
OK I think I understand your concern now.. the issue is that basically you cannot do "start" without first doing "enable", am I right?
from avahi.
It looks like systemd cannot start it automatically without the link... it's like a nonsense to me :/
Using the link is "bad" because... some kind if policy, but systemd tries to use that link to start it when needed
On the other hand, they force people to "enable" the service (and, then, having it enabled always) to get it started :|
from avahi.
it is basically unnecessary because avahi-daemon.service is anyway automatically started at boot up
It can go down for whatever reason in the process and if it is enabled it can be started again via D-Bus so clients using D-Bus API can somewhat fix transient issues.
systemd uses a very similar pattern for several of its services
It doesn't use it for services receiving network packets like resolved
, networkd
and timesyncd
and avahi
falls into that category. If it isn't enabled explicitly it's unlikely that the firewall and the network interfaces are set up either.
I think it can be closed.
from avahi.
Related Issues (20)
- Hosts are no longer discovered HOT 9
- Update avahi-resolve and avahi-browse to support a mode to force lookup over mdns only HOT 4
- There is a memory leak in dnsconfd
- Add cups service disable HOT 2
- simple-protocol.c:575: simple_protocol_restart_queries: Assertion `server' failed.
- avahi-daemon responds to A queries on 127.0.0.1 but not ::1 HOT 5
- avahi no longer responds to legacy unicast queries on ::1 HOT 2
- Fix various wide-area-dns limitations HOT 1
- Attempting to use internal strlcpy with newer versions of glibc causes compiler error HOT 17
- returning service types as services HOT 23
- avahi fails under UBSan with clang >= 17 because of `-fsanitize=function`
- Additional resource records are put in the answer section instead of the additional section HOT 5
- New Feature: Support wide-area DNS-SD publishing HOT 9
- The CI should run the python tests
- avahi fails to compile with `-Werror`
- ServiceTypeDatabase.py: TypeError: cannot use a string pattern on a bytes-like object
- Statically defined avahi service inaccessible, whilst manual published equivalent is accessible HOT 3
- The service is not published after the start HOT 4
- Integrate avahi with Weblate
- avahi fails to compile with "cannot stat 'service-types.db.coming': No such file or directory" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from avahi.