[Pkg-utopia-maintainers] Bug#686294: /var/run/avahi-services: easy way to announce running services
Michael Biebl
biebl at debian.org
Sat Nov 21 20:01:35 GMT 2026
Hi,
this should be discussed and implemented upstream at
https://github.com/avahi/avahi/
Regards,
Michael
On Fri, 31 Aug 2012 00:25:07 +0200 chrysn <chrysn at fsfe.org> wrote:
> Package: avahi-daemon
> Version: 0.6.31-1
> Severity: wishlist
>
> in this bug report, i'd like to propose a way for other packages to
> announce their services in an easy way, without being prone to the
> problems of installing to /etc/avahi/services/.
>
> existing solutions
> ==================
>
> so far, packages can announce their services either by
>
> * depositing a description in /etc/avahi/services
>
> this has the disadvantage of the service being announced independently
> of whether the process is just running. if a daemon gets configured
> not to start, the file has to be removed manually, and in theory, it
> should even be disabled when the daemon is stopped. it's worse even
> when different packages are involved (#622336).
>
> * integrating the avahi library
>
> some upstream software does this, but authors are often reluctant to
> pull in additional dependencies (eg [transmission]).
>
> * using the dbus api
>
> didn't investigate into how this works precisely, but for most server
> processes, this would mean an additional dependency as well (this was
> pondered in [transmission]).
>
> proposal
> ========
>
> it is suggested to create a new directory /var/run/avahi-services, which
> should be treated as equivalent to /etc/avahi/services by the daemon, ie
> should be watched for file changes and published.
>
> packages could then easily add a `cp /etc/my_daemon/my_daemon.service
> /var/run/avahi-services/` line to their start routine, and remove the
> file when the daemon gets stopped. on an unclean shutdown, /var/run gets
> cleaned at bootup anyway afaik.
>
> in cases like ssh, on which serices like ssh-udisks likely want to
> piggy-back (cf #622336), the openssh-server package could keep an
> /etc/ssh/avahi-services/ directory and copy all the files there to
> /var/run/avahi-services at startup; udisks would just need to drop its
> service description in /etc/ssh/avahi-services/udisks.service and be
> done with it.
>
> if the file monitoring of avahi-daemon is flexible enough, it would be a
> good idea to recursively watch /var/run/avahi-services; not only would
> that ease the task of ssh-like packages.
>
> init scripts that configure their daemons via command line args loaded
> from /etc/default (eg hddtemp) can, because they already have explicit
> knowledge of ports etc, also use serice templates like this:
>
> sed "s/__PORT__/${PORT}/g" /etc/my_daemon/avahiservice.in > /var/run/avahi-services/my_daemon.service
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-utopia-maintainers/attachments/20261121/4f819f8c/attachment.sig>
More information about the Pkg-utopia-maintainers
mailing list