I have the following service file:
Occasionally, when the machine reboots, it does not run. Here is the evidence:
[Unit]Description=DAfter=network.target[Service]ExecStart=/usr/local/sbin/mktags.pyType=oneshotUser=root[Install]WantedBy=multi-user.target
Occasionally, when the machine reboots, it does not run. Here is the evidence:
# uptime
05:50:11 up 20 min, 1 user, load average: 0.14, 0.03, 0.01
05:50:11 up 20 min, 1 user, load average: 0.14, 0.03, 0.01
The machine has been up for 20 minutes, so it rebooted at 05:30
# systemctl status mktags.service
* mktags.service - D
Loaded: loaded (/etc/systemd/system/mktags.service; enabled; vendor preset: enabled)
Loaded: loaded (/etc/systemd/system/mktags.service; enabled; vendor preset: enabled)
Active: inactive (dead)
Weird... no indication of what the last process was... let's check journalctl:
# journalctl -u mktags.service | tail -4
-- Reboot --
Mar 14 05:25:22 sll9 systemd[1]: Starting D...
Mar 14 05:25:22 sll9 systemd[1]: mktags.service: Succeeded.
Mar 14 05:25:22 sll9 systemd[1]: Finished D.
# uptime
05:57:31 up 2 min, 1 user, load average: 0.31, 0.33, 0.14
05:57:31 up 2 min, 1 user, load average: 0.31, 0.33, 0.14
# systemctl status mktags.service
* mktags.service - D
Loaded: loaded (/etc/systemd/system/mktags.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Sun 2021-03-14 05:55:14 UTC; 2min 24s ago
Process: 468 ExecStart=/usr/local/sbin/mktags.py (code=exited, status=0/SUCCESS)
Main PID: 468 (code=exited, status=0/SUCCESS)
(more output indicated that the process indeed ran).
* mktags.service - D
Loaded: loaded (/etc/systemd/system/mktags.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Sun 2021-03-14 05:55:14 UTC; 2min 24s ago
Process: 468 ExecStart=/usr/local/sbin/mktags.py (code=exited, status=0/SUCCESS)
Main PID: 468 (code=exited, status=0/SUCCESS)
(more output indicated that the process indeed ran).
I cannot detect any other errors elsewhere; if the service fails to start, and I reboot, it invariably runs then. Obviously this is not a solution; these are unattended machines running on GCE!
_______________________________________________ systemd-devel mailing list systemd-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/systemd-devel