How to make systemd kill or stop respawning the rsyslog daemon

John Greene picture John Greene · Jan 14, 2018 · Viewed 9k times · Source

It is great that systemd can keep rsyslog daemon alive even when it dies.

But I am crafting a new rsyslog configuration file and need to start this rsyslog daemon in debug mode. Before I debug rsyslogd, I need to stop the production rsyslog daemon, so I executed:

systemctl stop rsyslogd.service

But that command doesn't stop rsyslog daemon. Killing it via Unix signal doesn't keep systemd from respawning rsyslogd:

kill -KILL <rsyslogd-pid>

Even executing systemctl mask rsyslogd.service doesn't stop the respawning.

How do I make systemd STOP respawning 'rsyslog' daemon so I can troubleshoot it using debug?

Answer

John Greene picture John Greene · Jan 14, 2018

Well, after reading this bug report link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815862

This appears counter-intuitive...but the actual steps to perform is you have to stop TWO systemd units, and not just the rsyslog.service:

systemctl stop syslog.socket rsyslog.service

Problem solved.