I have a host running rsyslog which uses imuxsock to accept messages from journald. However, during boot, after rsyslog is started, it is restarted (stopped and started) again by systemd. I need to know why systemd did this.
How can we know what caused systemd to restart a service ? (in this case, it was soon after initial start)
I am facing an issue where for the time difference of a minute or so between journald start and rsyslog start, i only see kernel messages in rsyslog (and no user-space messages). However, after rsyslog start time, user-space messages are also seen. I guess the unexpected restart may have something to with this.
I have "Restart=on-failure" in the service file.
Here are the logs from my host which don't provide a clue for the cause of restart.
host_1:/home/admin# journalctl -u rsyslog --no-pager -- Logs begin at Thu 2019-10-24 15:01:58 UTC, end at Thu 2019-10-24 17:20:37 UTC. -- Oct 24 15:03:25 host_1 rsyslogd[5332]: environment variable TZ is not set, auto correcting this to TZ=/etc/localtime [v8.36.0 try http://www.rsyslog.com/e/2442 ] Oct 24 15:03:25 host_1 rsyslogd[5332]: imuxsock: Acquired UNIX socket '/run/systemd/journal/syslog' (fd 3) from systemd. [v8.36.0] Oct 24 15:03:25 host_1 rsyslogd[5332]: [origin software="rsyslogd" swVersion="8.36.0" x-pid="5332" x-info="http://www.rsyslog.com"] start Oct 24 15:03:25 host_1 systemd[1]: Starting System Logging Service... Oct 24 15:03:25 host_1 systemd[1]: Started System Logging Service. Oct 24 15:03:26 host_1 systemd[1]: Stopping System Logging Service... Oct 24 15:03:26 host_1 rsyslogd[5332]: [origin software="rsyslogd" swVersion="8.36.0" x-pid="5332" x-info="http://www.rsyslog.com"] exiting on signal 15. Oct 24 15:03:26 host_1 systemd[1]: Stopped System Logging Service. Oct 24 15:03:26 host_1 systemd[1]: Starting System Logging Service... Oct 24 15:03:26 host_1 rsyslogd[6201]: environment variable TZ is not set, auto correcting this to TZ=/etc/localtime [v8.36.0 try http://www.rsyslog.com/e/2442 ] Oct 24 15:03:26 host_1 systemd[1]: Started System Logging Service. Oct 24 15:03:26 host_1 rsyslogd[6201]: imuxsock: Acquired UNIX socket '/run/systemd/journal/syslog' (fd 3) from systemd. [v8.36.0] Oct 24 15:03:26 host_1 rsyslogd[6201]: [origin software="rsyslogd" swVersion="8.36.0" x-pid="6201" x-info="http://www.rsyslog.com"] start