Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/index.php/Reporting_Bug_Guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#67384 - Systemd timer fails to ignore "Persistant"-flag

Attached to Project: Arch Linux
Opened by Volker WeiƟmann (volker_weissmann) - Friday, 24 July 2020, 17:41 GMT
Last edited by freswa (frederik) - Sunday, 26 July 2020, 14:13 GMT
Task Type Bug Report
Category System
Status Closed
Assigned To No-one
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

The documentation of systemd (https://www.freedesktop.org/software/systemd/man/systemd.timer.html) claims that the "Persistant"-flag is ignored if the timer was not configured with OnCalendar, but I found out that this is not always the case, and setting Persistent=true can break a timer.
I tested the script below on two nearly identical machines: On one machine, both Persistant=true and Persistant=false results in a working timer, but on the other machine, Persistant=false works, but Persistant=true does not.


$ systemctl --user list-timers
NEXT LEFT LAST PASSED UNIT ACTIVATES
Fri 2020-07-24 20:29:16 CEST 59min left Fri 2020-07-24 19:29:16 CEST 32s ago test_false.timer test_false.service
n/a n/a Fri 2020-07-24 19:27:24 CEST 2min 24s ago test_true.timer test_true.service


reproduce.sh:
systemctl --user disable --now test_true.timer
systemctl --user disable --now test_false.timer
systemctl --user clean test_true.timer --what=state
systemctl --user clean test_false.timer --what=state
sudo cp test_true.service test_false.service test_true.timer test_false.timer /etc/systemd/user/
systemctl --user enable --now test_true.timer
systemctl --user enable --now test_false.timer

test_true.service and test_false.service:
[Unit]
Description=Test service
[Service]
Type=simple
ExecStart=pwd

test_true.timer:
[Unit]
Description=Timer test
[Timer]
OnBootSec=10s
OnUnitActiveSec=1hour
Persistent=true
[Install]
WantedBy=timers.target

test_false.timer:
[Unit]
Description=Timer test
[Timer]
OnBootSec=10s
OnUnitActiveSec=1hour
Persistent=false
[Install]
WantedBy=timers.target



This task depends upon

Closed by  freswa (frederik)
Sunday, 26 July 2020, 14:13 GMT
Reason for closing:  Not a bug
Additional comments about closing:  You write, that the only occurs on one of your machines. So this is probably a configuration/system specific bug and not one of the package. Please open a forum topic, or ask for help on the ML or IRC to discuss this in depth. If it turns out to be an issue of the package, feel free to fill a reopen request.
Thank you

Loading...