Posted a question last night about not being able to ssh my pi. Connected the pi to a monitor and the following error came up:

Failed to start Avahi mDNS/DNS-SD Stack

This is stopping me from logging in to the pi and doesn't even give me the prompt so I cannot edit files.

I read, however, that you can edit files on the SD card.

Any suggestions on fixing this login issue?



Avahi uses a SysV style init script, with which Systemd is backward compatible, and enabling the service reports this:

insserv: warning: current start runlevel(s) (empty) of script `avahi-daemon' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `avahi-daemon' overrides LSB defaults (0 1 6).
Executing /usr/sbin/update-rc.d avahi-daemon enable
Created symlink from /etc/systemd/system/dbus-org.freedesktop.Avahi.service to /lib/systemd/system/avahi-daemon.service.
Created symlink from /etc/systemd/system/sockets.target.wants/avahi-daemon.socket to /lib/systemd/system/avahi-daemon.socket.

Enabling a service with systemd is really about creating symlinks, as it is for SysV, so it is easy to disable something with the system offline by modifying the filesystem. In this case we have to take care of both set of symlinks. That means deleting:


These are just symbolic links, so nothing is really deleted that is not equally easy to put back, and as far as I'm aware this is all disabling the service properly will do -- systemd does not keep any further database or record beyond this.

Except if there are other things that depend on Avahi. However, hopefully there are not in your case, and if so, I believe they should just fail to be run.

There are also the SysV style links. Those are in /etc/rc[0-6].d. In rc0.d and rc6.d they will most likely be called K01avahi-daemon and in rc[1-5].d, S04avahi-daemon, but that may depend on what else is enabled. In any case, it will just be the two numbers after the S or K that is different.

Delete all those too and the system will now boot up without starting Avahi. If you want, afterward you can do this properly to make sure any complications are dealt with (again, I doubt there are any):

sudo systemctl enable avahi-daemon
sudo systemctl disable avahi-daemon
| improve this answer | |

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.