On bootup we trigger the service initialization script that is shown below. The script is a part of Instance
This script copies the necessary service/timer things to
systemd folder and starts a timer.
From time to time after reboot our timers are not working and stays in
sudo systemctl restart cleanup.timer command does not help.
systemctl stop cleanup.timer and then
sudo systemctl start cleanup.timer works.
We have this problem not only with a particular timer. We got lot of timers with almost same structure and initialization service. All timers are loaded but some of them can be in
active (elapsed) status and not working.
Ubuntu 18.04 LTS.
We have this service initialization script:
sudo cp <BASIC PATH>/services/cleanup.service /etc/systemd/system/cleanup.service
sudo cp <BASIC PATH>/services/cleanup.timer /etc/systemd/system/cleanup.timer
sudo systemctl daemon-reload
sudo systemctl start cleanup.timer
Description=Service to cleanup things
Description=Timer for service to cleanup things
Now check these commands:
> sudo systemctl list-timers
NEXT LEFT LAST PASSED UNIT ACTIVATES
n/a n/a n/a n/a cleanup.timer cleanup.service
> sudo systemctl status cleanup.timer
● cleanup.timer - Timer for service to cleanup things
Loaded: loaded (/etc/systemd/system/cleanup.timer; disabled; vendor preset: enabled)
Active: active (elapsed) since Wed 2021-11-17 21:07:22 UTC; 11h ago
Nov 17 21:07:22 ip-XX-XX-XX-XX systemd: Started Timer for service to cleanup things.
What could be the reason of this situation and how to avoid it?