Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I disable avahi-daemon and can you explain to me how it runs if it appears as a service but it itsn't in rcN.d?

You can stop reading here. In fact, please do unless you want to TEACH a noob some Ubuntu. The question above should be clear enough to be answered. The rest is just me calling out for some more structured way of finding one's way around Ubuntu. I can more or less use other "UNIX-like" systems.

I am a beginner so if I act nonsensically, consider me your daily WTF but do help me improve, please.

At every boot, /sbin/init seems to be launching a process called avahi-daemon

# initctl list | grep avahi
avahi-daemon start/running, process 1280

as user avahi

# id avahi
uid=107(avahi) gid=118(avahi) groups=118(avahi)

a ps -efww ef shows 2 processes active, both called avahi-daemon, and the PPID of the first avahi-daemon is indeed 1, the second process is just a child of the first. The PPID = 1 is what makes me think this was auto-started.


I don't really know how to check properly what gets executed at system startup, thinking about it.

Is this the way to get a list of services that run at startup? initctl list | sort

anyway, I seem to be able to temporarily stop this "service" through this command:

service avahi-daemon stop

or indeed this command

/etc/init.d/avahi-daemon stop

directly, which is what this /usr/sbin/service seems to be using:


When launched, the script reminds me that I am controlling an "Upstart" service, and that I should use the simpler invocation stop avahi-daemon. I guess I will need to learn about Upstart but for now, all I need to learn is this:

how do I disable services in Ubuntu?

Here is what I tried (this should be the proper way to do it, or is it not?):

update-rc.d avahi-daemon disable

but it complains:

System start/stop links for /etc/init.d/avahi-daemon do not exist

so I went hunting for the path to the binary:

# Let me know if there is a better way to get the path above
readlink "/proc/$(echo `ps --no-headers -o pid -C avahi-daemon | head -n 1`)/exe"

which is this:


and anything that could be considered an "executable file" in etc:

find /etc -type f -name '*avahi*' -perm -u+x

thinking I would find startup scripts in /etc/rcN.d. I found other things instead:


seems like this avahi-daemon thing is being launched on network state changes? Is there a better way to hunt down binaries automatically started on a system?

I would have normally obliterated the symlinks in the various rc{3,5}.d at this stage but now I am not too sure. What exactly starts this beast? How to disable it without apt-get remove or apt-get purge?

It does not have too many resources open, as far as I can see:

lsof -p $(echo `ps --no-headers -o pid -C avahi-daemon | head -n 1`)

nor does it use too many CPU cycles, based on a quick glance at htop.

I wrote this one-liner to see if it goes funky on CPU util over a period of one minute, and it never does, but let me know if there are better ways to check that:

for i in {1..59}; do ps -p $(echo `ps --no-headers -o pid -C avahi-daemon | head -n 1`) --no-headers -o pcpu; sleep 1; done
share|improve this question
A for effort! – Geoff Dec 10 '13 at 21:27
up vote 17 down vote accepted

Upstart startup scripts live in /etc/init, where you can find avahi-daemon.conf. All things listed in initctl list match to scripts in /etc/init, and they are not executable, thus your find missed them.

To disable a Upstart controlled service, see Upstart cookbook on disabling services: either add # to start on line, or use override files (example: sudo sh -c "echo manual > /etc/init/avahi-daemon.override").

share|improve this answer
sudo systemctl disable avahi-daemon

worked for me on Ubuntu Gnome 15.10

share|improve this answer

You might not need to stop it from starting up when PC boots, but maybe prevent it from respawn as it does, when you kill it.

So, just comment out the respawn in /etc/init/avahi-daemon.conf

Killing that process always failed, so couldn't get airmon-ng check to pass. Commenting out the respawning, it kills and never comes back hunting me.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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