You are not logged in.

#1 2014-09-16 02:46:45

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

[SOLVED] systemd daily timers out of sync

Somehow some of my systemd daily timers got out of sync:

# systemctl list-timers
NEXT                         LEFT                  LAST                         PASSED                UNIT                         ACTIVATES
Di 2014-09-16 23:02:48 CEST  18h left              Mo 2014-09-15 23:02:48 CEST  5h 19min ago          systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
Mi 2014-09-17 00:00:00 CEST  19h left              Di 2014-09-16 00:00:08 CEST  4h 22min ago          pkgfile-update.timer         pkgfile-update.service
Di 2014-12-09 00:00:00 CET   2 months 22 days left Mo 2014-12-08 00:37:24 CET   2 months 22 days left logrotate.timer              logrotate.service
Di 2014-12-09 00:00:00 CET   2 months 22 days left Mo 2014-12-08 00:37:24 CET   2 months 22 days left man-db.timer                 man-db.service
Di 2014-12-09 00:00:00 CET   2 months 22 days left Mo 2014-12-08 00:37:24 CET   2 months 22 days left shadow.timer                 shadow.service
Di 2014-12-09 00:00:00 CET   2 months 22 days left Mo 2014-12-08 00:37:24 CET   2 months 22 days left updatedb.timer               updatedb.service
Mo 2014-12-15 00:00:00 CET   2 months 28 days left Mo 2014-12-08 00:37:24 CET   2 months 22 days left pkgstats.timer               pkgstats.service

The NEXT field shows the logrotate.timer .. pkgstats.timer scheduled too far in the future. Thus they won't run in a daily fashion. This may probably be caused by a recent realtime clock malfunction where the time had been set ahead in some session.

Does anyone know of a way to reset these schedules?

Last edited by bernarcher (2014-09-16 10:22:55)


To know or not to know ...
... the questions remain forever.

Offline

#2 2014-09-16 03:15:40

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,999

Re: [SOLVED] systemd daily timers out of sync

On a personal moderator note, I sure as heck miss having you around.  Glad to see you and I hope all is well.

Do these errors survive a restart?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2014-09-16 08:36:00

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [SOLVED] systemd daily timers out of sync

I would try deleting '/var/lib/systemd/timers/stamp-*.timer' and see if things get back to normal.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#4 2014-09-16 10:21:40

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: [SOLVED] systemd daily timers out of sync

Thanks to ROOKIE I learned another systemd trick. The timer schedules are indeed managed through the /var/lib/systemd/timers/stamp* files. These were the faulty stamps:

-rw-r--r-- 1 root root 0  8. Dez 2014  stamp-logrotate.timer
-rw-r--r-- 1 root root 0  8. Dez 2014  stamp-man-db.timer
-rw-r--r-- 1 root root 0  8. Aug 00:00 stamp-pkgfile.timer
-rw-r--r-- 1 root root 0 16. Sep 00:00 stamp-pkgfile-update.timer
-rw-r--r-- 1 root root 0  8. Dez 2014  stamp-pkgstats.timer
-rw-r--r-- 1 root root 0  8. Dez 2014  stamp-shadow.timer
-rw-r--r-- 1 root root 0  8. Dez 2014  stamp-updatedb.timer

Note e.g. the December dates. Removing those files did force systemd to store new stamps after a restart:

-rw-r--r-- 1 root root 0 16. Sep 11:57 stamp-logrotate.timer
-rw-r--r-- 1 root root 0 16. Sep 11:57 stamp-man-db.timer
-rw-r--r-- 1 root root 0 16. Sep 11:57 stamp-pkgfile-update.timer
-rw-r--r-- 1 root root 0 16. Sep 11:57 stamp-pkgstats.timer
-rw-r--r-- 1 root root 0 16. Sep 11:57 stamp-shadow.timer
-rw-r--r-- 1 root root 0 16. Sep 11:57 stamp-updatedb.timer

The timers listing appears to be ok now:

~%  systemctl list-timers --all
NEXT                         LEFT        LAST                         PASSED       UNIT                         ACTIVATES
n/a                          n/a         Di 2014-09-16 11:58:30 CEST  1min 24s ago systemd-readahead-done.timer systemd-readahead-done.service
Di 2014-09-16 12:10:12 CEST  10min left  n/a                          n/a          systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
Mi 2014-09-17 00:00:00 CEST  12h left    n/a                          n/a          logrotate.timer              logrotate.service
Mi 2014-09-17 00:00:00 CEST  12h left    n/a                          n/a          man-db.timer                 man-db.service
Mi 2014-09-17 00:00:00 CEST  12h left    n/a                          n/a          pkgfile-update.timer         pkgfile-update.service
Mi 2014-09-17 00:00:00 CEST  12h left    n/a                          n/a          shadow.timer                 shadow.service
Mi 2014-09-17 00:00:00 CEST  12h left    n/a                          n/a          updatedb.timer               updatedb.service
Mo 2014-09-22 00:00:00 CEST  5 days left n/a                          n/a          pkgstats.timer               pkgstats.service

However, I did not yet find any documentation about this feature. Can you provide any pointers, ROOKIE?

----------

@ewaller: It is a good feeling to be remembered well. I surely miss the mods team from time to time. All is well around here except my time is still limited. To you all: Keep up the good work.


To know or not to know ...
... the questions remain forever.

Offline

#5 2014-09-16 13:12:06

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [SOLVED] systemd daily timers out of sync

I'm _almost_ sure this timestamp thing is documented somewhere. I have stumbled upon this by accident (and looking at the sources) when trying to figure out a time/date problem on an rtc less system.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#6 2014-09-18 04:37:48

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: [SOLVED] systemd daily timers out of sync

I added a few lines about those stamp-* files to the systemd/cron functionality wiki.


To know or not to know ...
... the questions remain forever.

Offline

Board footer

Powered by FluxBB