New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.timer doesn't fire #6680
Comments
|
how does your timer service look like? Is that a Type=oneshot service? |
|
Yup! |
|
hmm, so OnUnitActiveSec= operates relative to a unit becoming active, but Type=oneshot service units actually never become active, unless you combine them with RemainAfterExit=, hence the confusion... Type=oneshot units after all do stuff during their start-up and when that's complete they go down again, they never stay up continiously... Hence, combining Type=oneshot with OnUnitActiveSec= can't really work... This is a big underdocumented though |
|
would OnUnitInactiveSec work in this case ? |
|
How come it never even fired the first time due to OnActiveSec=1m? Also, the problem happens intermittently, that is very strange too. |
|
ping |
|
I'm seeing this issue sporadically with some of my timers as well, on systemd 238. Is there any information I can gather to help debug? |
|
I observe this issue as well with systemd 237. My timer at some point just stopped activating the service. I use As in the issue description, my timer now has Full outputs and unit files: https://gist.github.com/nh2/623947890cf98b9df87fbd652f76b70b |
|
A similar report by somebody else I found: https://serverfault.com/questions/775246/systemd-timer-not-starting-its-service-unit It suggests that adding an explicit |
|
I tried stopping and starting the Then I tried the above linked suggestion
Adding an explicit Oddly, the Then, after I killed the process controlled by the |
Summary: Because of systemd/systemd#6680 This is listed as the work-around, and we have plenty of hosts which seem to be experiencing this bug. Reviewed By: malmond77 Differential Revision: D15908156 fbshipit-source-id: eace4c0e284b3550ccaef414bf63662d8b147cfd
Summary: D15908156 added a `Requires=` directive which was supposed to help, according to systemd/systemd#6680 But this doesn't even work: ``` systemd[1]: /etc/systemd/timers/test.timer:11: Unknown lvalue 'Requires' in section 'Timer', ignoring ``` Reviewed By: davide125 Differential Revision: D16075782 fbshipit-source-id: 7310573a08c01d1f3a584537f3200e619d4d7431
Summary: Because of systemd/systemd#6680 This is listed as the work-around, and we have plenty of hosts which seem to be experiencing this bug. My previous attempt was wrong, put it in the right place this time so it works. It did work on the test host. Reviewed By: dsesh, davide125 Differential Revision: D16135632 fbshipit-source-id: 70a20f27c7a08bd79d6293caef8b7693c21ad92f
systemd timers have a bug: systemd/systemd#6680 ... where OnUnitActiveSec doesn't work right for oneshot services unless you set Requires=myservice.service as per: https://serverfault.com/questions/775246/systemd-timer-not-starting-its-service-unit Also set Persistent=true to make sure the update on reboot.
|
I can confirm the problem with systemd 219 on CentOS 7. I'm using timer with And sometimes, after reboot, timer won't start firing (yes, it's enabled). Adding
I'd suggest adding |
|
Should be the label |
|
I am also seeing the same issue where occasionally my log-rotate timers are in Timer: Some questions,
Timer:
|
|
@nmahaba Did you reboot first? |
|
@dresken Yes, I rebooted the system and performed multiple |
|
@poettering Do you have any thoughts on this ? |
As you later wrote, the issue is with initial timer firing. So,
Which means that your .service unit will be started together with .timer which solves the problem of initial firing. |
|
The workaround of using |
|
I'm a bit confused. What exactly is the recommended way to run a oneshot service, or if that is difficult, restart a normal service n days after the last successful execution, if
I can build a solution with manual timestamping and cron, of course, but I was under the impression this should be easier with systemd. All of these requirements are real, BTW, for letsencrypt renewal, which you don't want to run too often, you need to run regularly, and sometimes you need to run manually, which should push back the next automatic run, which excludes just using oncalendar. |
|
CLOSED WONTFIX for RHEL7 - hopefully gets addressed in RHEL8 - https://bugzilla.redhat.com/show_bug.cgi?id=1764908 |
|
Hi all, what solved for me was, I had to start the |
What about the next time you reboot? This sounds like a work around and not a solution |
|
For that, you can set `Persistent=true`. Also, since this is a server, I
probably will reboot very infrequently, so I can start it manually the few
times I do reboot.
|
Persistent=true does not address this issue - as it only works with OnCalendar (see https://www.freedesktop.org/software/systemd/man/systemd.timer.html) I am glad you have the ability to be present and manually intervene with your server every time it is rebooted. The sheer scale of the operations we work with makes this impossible - so forgive us that we would like this bug actually addressed in an appropriate fashion. |
@dresken Closed as fixed in February, with the link to the fix being redhat-plumbers/systemd-rhel7#130. But that appears to be a backport of #10778 which was merged to systemd in 2018. |
|
I'm seeing something that may be the same issue, but with an After booting up with a stamp file that is several days old (actually from a disk image, not the same instance), This is on systemd 245. |
|
Can this be closed as per #10778? |
|
Is there any news? I'm using systemd-239-58 and still experiencing these problems with oneshot services. @poettering cat /etc/systemd/system/callback.service cat /etc/systemd/system/callback.timer systemctl list-timers |grep callback systemctl status callback systemctl status callback.timer |
Submission type
systemd version the issue has been seen with
Used distribution
log-rotate.timer never starts.
Status of the timer
Timer file
The text was updated successfully, but these errors were encountered: