[systemd-devel] Question about OnUnitInactiveSec= directive
Mikhail Kasimov
mikhail.kasimov at gmail.com
Fri Jul 8 22:37:40 UTC 2016
Hello!
Have a .timer service like:
======
[Unit]
Description=Runs VBA32 Update Hourly
Requires=timers.target
[Timer]
OnBootSec=2min
OnUnitInactiveSec=1h
[Install]
WantedBy=timers.target
======
to run vba32update.service in 1 hour after previous update-session is
over (OnUnitInactiveSec=1h).
From man-page: "|OnUnitInactiveSec=| defines a timer relative to when
the unit the timer is activating was last deactivated."
Ok, here is log-snippet:
======
Июл 08 22:05:00 linux-mk500 systemd[1]: Starting VBA32 Anti-Virus Update
Service...
Июл 08 22:05:00 linux-mk500 vbacl[14768]: Vba32 console scanner update
process started
Июл 08 22:05:00 linux-mk500 vbacl[14768]: Reading configuration options
from ./vbacl.ini
Июл 08 22:05:00 linux-mk500 vbacl[14768]: Using direct connection for update
Июл 08 22:05:02 linux-mk500 vbacl[14768]: Current dir is ./
Июл 08 22:05:02 linux-mk500 vbacl[14768]: Start update from
http://anti-virus.by/update
Июл 08 22:05:02 linux-mk500 vbacl[14768]: Receiving file list
Июл 08 22:05:02 linux-mk500 vbacl[14768]: File list received
Июл 08 22:05:02 linux-mk500 vbacl[14768]: Update is not needed
Июл 08 22:05:02 linux-mk500 systemd[1]: Started VBA32 Anti-Virus Update
Service.
Июл 08 23:05:13 linux-mk500 systemd[1]: Starting VBA32 Anti-Virus Update
Service...
Июл 08 23:05:13 linux-mk500 vbacl[15289]: Vba32 console scanner update
process started
Июл 08 23:05:13 linux-mk500 vbacl[15289]: Reading configuration options
from ./vbacl.ini
Июл 08 23:05:13 linux-mk500 vbacl[15289]: Using direct connection for update
Июл 08 23:05:17 linux-mk500 vbacl[15289]: Current dir is ./
Июл 08 23:05:17 linux-mk500 vbacl[15289]: Start update from
http://anti-virus.by/update
Июл 08 23:05:17 linux-mk500 vbacl[15289]: Receiving file list
Июл 08 23:05:17 linux-mk500 vbacl[15289]: File list received
Июл 08 23:05:17 linux-mk500 vbacl[15289]: Update is not needed
Июл 08 23:05:17 linux-mk500 systemd[1]: Started VBA32 Anti-Virus Update
Service.
Июл 09 00:05:20 linux-mk500 systemd[1]: Starting VBA32 Anti-Virus Update
Service...
Июл 09 00:05:20 linux-mk500 vbacl[16050]: Vba32 console scanner update
process started
Июл 09 00:05:20 linux-mk500 vbacl[16050]: Reading configuration options
from ./vbacl.ini
Июл 09 00:05:20 linux-mk500 vbacl[16050]: Using direct connection for update
Июл 09 00:05:24 linux-mk500 vbacl[16050]: Current dir is ./
Июл 09 00:05:24 linux-mk500 vbacl[16050]: Start update from
http://anti-virus.by/update
Июл 09 00:05:24 linux-mk500 vbacl[16050]: Receiving file list
Июл 09 00:05:24 linux-mk500 vbacl[16050]: File list received
Июл 09 00:05:24 linux-mk500 vbacl[16050]: Update is not needed
Июл 09 00:05:24 linux-mk500 systemd[1]: Started VBA32 Anti-Virus Update
Service.
Июл 09 01:05:50 linux-mk500 systemd[1]: Starting VBA32 Anti-Virus Update
Service...
Июл 09 01:05:50 linux-mk500 vbacl[16528]: Vba32 console scanner update
process started
Июл 09 01:05:50 linux-mk500 vbacl[16528]: Reading configuration options
from ./vbacl.ini
Июл 09 01:05:50 linux-mk500 vbacl[16528]: Using direct connection for update
Июл 09 01:05:55 linux-mk500 vbacl[16528]: Current dir is ./
Июл 09 01:05:55 linux-mk500 vbacl[16528]: Start update from
http://anti-virus.by/update
Июл 09 01:05:55 linux-mk500 vbacl[16528]: Receiving file list
Июл 09 01:05:55 linux-mk500 vbacl[16528]: File list received
Июл 09 01:05:55 linux-mk500 vbacl[16528]: Update is not needed
Июл 09 01:05:55 linux-mk500 systemd[1]: Started VBA32 Anti-Virus Update
Service.
======
We see 22:05:02 (end of update-session) --> 23:05:13 (start of next
update-session) --> 23:05:17 (end of update-session) --> 00:05:20 (start
of next update-session) --> 00:05:24 (end of update-session) -->
01:05:50 (start of next update-session) --> 01:05:55 (end of
update-session).
Question: Why time of new update-session is *not* equal to time of end
of previous update-session + 1h in section of seconds, e.g. 23:05:17 +1h
= 00:05:17; 00:05:24 + 1h = 01:05:24 and so on? Is here a way to reach
this precise coincidence?
Thanks!
Platform: x64, openSUSE Leap 42.1, systemd 210.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20160709/f2f49da6/attachment.html>
More information about the systemd-devel
mailing list