2

I just learning about daemon, by that time I came know avahi daemon can you please explain detaily about avahi daemon and why linux has a avahi user ?

2
3

In short: avahi is a Linux implementation of a protocol also known as "Rendezvous" or "Bonjour"). Its goal is to let devices, conected to the local network, to broadcast their IP-address together with their function . Hence the printer can from time to time broadcasts : My IP is 192.168.23.45 and I can print any postscript document with ipp prottocol; a NAS can say: My IP is 192.168.23.88 and I can stream music, save your bacups, and serve as a fileserver. If it is not what you want to hear on your network you can stop / disable the avahi daemon with standard systemctl command. But if you run a cups-broadcast daemon, it will start the avahi itself.

Linux uses fictive users usualy for security reasons, not to give the attacker any chance to hack a process own by root. So you can see a postfix or mail, and postgres or mysql users. The daemon, owened by such unprivileged user, gives less chance for the attacker to get the superuser rights.

6
  • Is the daemon only for broadcasting, or also for reception? – einpoklum Feb 23 at 21:11
  • Definitely yes, the avahi daemon listens UDP port 5353. You can check it with the command netstat -lup or ss -lup as superuser. – schweik Feb 24 at 10:27
  • But what is this listening used for? What benefits from having avahi running? – einpoklum Feb 24 at 10:30
  • 1
    Well, I do not want to start a flame. But in my local net it is for nothing, I set and thats why I know all IP and function of all devices in my network. For a large network, or for net without an smart admin, this protocol (and hence its daemons) can make the network configuration easier, but you pay for it with more noise on your net. After connecting the new net-printer (which gets its IP by dhcp) you can start to configure your printing subsystem by asking for all print capable new devices, without knowing ist IP. – schweik Feb 24 at 10:57
  • @einpoklum The broadcasts (or multicasts) happen at intervals (like every 30 seconds), so avahi-daemon listens for local Rendezvous/Bonjour broadcasts and caches the list of systems it hears about, so applications using the Avahi libraries will get the list of Rendezvous/Bonjour devices essentially immediately. So when you e.g. open a "select network printer" dialog, you'll get an essentially complete list immediately, instead of having to wait up to 30 seconds for the printers to pop in one by one. – telcoM Feb 24 at 12:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.