Bug 88725

Summary: RFE: option to make timer units with Persistent=yes fire immediately the first time they are started
Product: systemd Reporter: me
Component: generalAssignee: systemd-bugs
Status: NEW --- QA Contact: systemd-bugs
Severity: normal    
Priority: medium CC: alexandre, me
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
i915 platform: i915 features:

Description me 2015-01-23 00:48:01 UTC
A persistent timer that has not previously fired will not fire on startup, this is valid per a pedantic reading of the man page.  For the needs of an individual with a laptop it would be nice to not have to leave the laptop on overnight just to get a last-run timestamp so that Persistent works.  I haven't found a method to fake the timer having fired unfortunately.

Details showing how persistent=true behaves:

systemd 218

NEXT                         LEFT                LAST                         PASSED       UNIT                           ACTIVATES
Fri 2015-01-23 00:00:00 EST  4h 36min left       n/a                          n/a          zfs-auto-snapshot-daily.timer  zfs-auto-snapshot-daily.service

relevant unit parts:

The above timer has been enabled on my laptop for the last 3 days.  My laptop is not on as midnight and so the timer doesn't fire.  

Another timer:

Thu 2015-01-22 20:00:00 EST  33min left          Thu 2015-01-22 19:00:15 EST  26min ago    zfs-auto-snapshot-hourly.timer zfs-auto-snapshot-hourly.service

Same basic idea, only hourly.  This DOES fire after my laptop comes out of suspend as shown here, snapshot names are in UTC, I put the EST time in last column
rpool/home@znap_2015-01-22-0300_hourly   15.7M      -  2.40G  -  - 10:00pm EST
rpool/home@znap_2015-01-22-1413_hourly   16.2M      -  2.40G  -  - 09:14am EST
rpool/home@znap_2015-01-22-1500_hourly   37.5M      -  2.40G  -  - 10:00am EST
rpool/home@znap_2015-01-22-1600_hourly   37.7M      -  2.40G  -  - 11:00am EST
Comment 1 Alexandre Detiste 2015-01-23 12:11:34 UTC
> I haven't found a method to fake the timer having fired unfortunately.
I can use 'touch' and set a date in the past + restarting the timer.

Can't help for the rest.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.