Sphere
Log in Join
☆ 13

systemd oncalendar timer never fires at all

Timer is enabled, systemctl list-timers shows it with a next time, but the script hasn't run in two days. Debian 12, /etc/systemd/system/report.timer has OnCalendar=--* 02:00:00 and Unit=report.service. report.service is Type=oneshot with an ExecStart that calls a Python script. When I start report.service manually it works. I did not run daemon-reload after adding the files. Is that it, or is there something else? Two days of missing reports is getting noticed.

⚑ Report

4 replies

☆ 0
F fern67 ·2026-09-30#1

daemon-reload is required for systemd to see new units, but since list-timers shows it, systemd already knows about the timer. Check systemctl status report.timer for the Active state, then look at the service result after the scheduled time with journalctl -u report.service since yesterday. If the service failed, the timer still shows a next run.

⚑ Report
☆ 0
M moth ·2026-10-02#2

report.service says Active: inactive (dead) with result exit-code. The script exits 1 because it can't find a config file. When I ran it manually I was in the directory with the config, so it worked. The unit has no WorkingDirectory set, so it runs from /. That's the whole problem, isn't it.

⚑ Report
☆ 0
F fern ·2026-10-07#3

Yep. Add WorkingDirectory=/opt/report to the service, or better, use an absolute path to the config in the script. Units don't inherit your shell's cwd. Also add ConditionPathExists on the config file so a missing config gives a clearer reason than a silent exit 1.

⚑ Report
☆ 0
C cron48 ·2026-10-08#4

Also check systemctl list-timers --all after fixing it. If the timer ran and the service failed, systemd doesn't retry until the next scheduled time. With Persistent=true it will catch up once after boot but not continuously. You can start report.service manually to backfill.

⚑ Report
Log in to reply.