A service dies and I only get to know about it by noticing that something is broken. I'm sure this is happening more since the Debian 8 upgrade which brought systemd, although I'm not entirely sure systemd is to blame.
I'm not sure whether previously init just restarted things that died and systemd doesn't.
They symptom is systemctl status foo.service
shows things like active (exited) or such.
Is there a way to notice a change in status in systemd managed services? And/or get it to attempt a restart a couple of times?
(I'm new to systemd.)
EDIT
Here's an example: Stunnel had stopped. Here's what I did to get it working again:
root@server:/root# systemctl status stunnel4
● stunnel4.service - LSB: Start or stop stunnel 4.x (SSL tunnel for network daemons)
Loaded: loaded (/etc/init.d/stunnel4)
Active: active (exited) since Sun 2016-05-01 07:03:54 BST; 2 days ago
Process: 13443 ExecStop=/etc/init.d/stunnel4 stop (code=exited, status=0/SUCCESS)
Process: 13455 ExecStart=/etc/init.d/stunnel4 start (code=exited, status=0/SUCCESS)
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
root@server:/root# systemctl stop stunnel4
root@server:/root# systemctl status stunnel4
● stunnel4.service - LSB: Start or stop stunnel 4.x (SSL tunnel for network daemons)
Loaded: loaded (/etc/init.d/stunnel4)
Active: inactive (dead) since Tue 2016-05-03 10:00:10 BST; 947ms ago
Process: 13006 ExecStop=/etc/init.d/stunnel4 stop (code=exited, status=0/SUCCESS)
Process: 13455 ExecStart=/etc/init.d/stunnel4 start (code=exited, status=0/SUCCESS)
May 03 10:00:10 servername stunnel4[13006]: Stopping SSL tunnels: stunnel.
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
✗ Error in last command
root@server:/root# systemctl start stunnel4
root@server:/root# systemctl status stunnel4
● stunnel4.service - LSB: Start or stop stunnel 4.x (SSL tunnel for network daemons)
Loaded: loaded (/etc/init.d/stunnel4)
Active: active (running) since Tue 2016-05-03 10:00:18 BST; 1s ago
Process: 13006 ExecStop=/etc/init.d/stunnel4 stop (code=exited, status=0/SUCCESS)
Process: 13031 ExecStart=/etc/init.d/stunnel4 start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/stunnel4.service
└─13044 /usr/bin/stunnel4 /etc/stunnel/stunnel.conf
May 03 10:00:18 servername stunnel4[13031]: Starting SSL tunnels: [Started: /etc/stunnel/stunnel.conf] stunnel.
The only logs I can find seem to be a restart:
syslog.2.gz:May 1 07:03:54 pap1 stunnel4[13443]: Stopping SSL tunnels: [stopped: /etc/stunnel/stunnel.conf] stunnel.
syslog.2.gz:May 1 07:03:54 pap1 stunnel4[13455]: Starting SSL tunnels: [Already running: /etc/stunnel/stunnel.conf] stunnel.
that looks like it failed. I cannot figure why the restart happened (other question on systemd), nor why it failed.