Re: [systemd-devel] Question about OnUnitInactiveSec= directive

2016-07-09 Thread Mikhail Kasimov

Seems, AccuracySec=1us parameter resolves this problem indeed:
=
Июл 09 10:55:30 linux-mk500 systemd[1]: Started VBA32 Anti-Virus Update 
Service.
Июл 09 11:00:30 linux-mk500 systemd[1]: Starting VBA32 Anti-Virus Update 
Service...


Июл 09 11:00:32 linux-mk500 systemd[1]: Started VBA32 Anti-Virus Update 
Service.
Июл 09 11:05:32 linux-mk500 systemd[1]: Starting VBA32 Anti-Virus Update 
Service...


Июл 09 11:05:35 linux-mk500 systemd[1]: Started VBA32 Anti-Virus Update 
Service.
Июл 09 11:10:35 linux-mk500 systemd[1]: Starting VBA32 Anti-Virus Update 
Service...

=

Haven't read about AccuracySec parameter in man-page carefully. :(

Resolved. Thank you again!

09.07.2016 08:23, Andrei Borzenkov пишет:

09.07.2016 01:37, Mikhail Kasimov пишет:

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.


...


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?


Please check with "systemctl status" or "systemctl show" when unit was
actually deactivated. Also see "AccuracySec" timer parameter.

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Question about OnUnitInactiveSec= directive

2016-07-08 Thread Andrei Borzenkov
09.07.2016 01:37, Mikhail Kasimov пишет:
> 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.
> 
...

> 
> 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?
> 

Please check with "systemctl status" or "systemctl show" when unit was
actually deactivated. Also see "AccuracySec" timer parameter.

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Question about OnUnitInactiveSec= directive

2016-07-08 Thread Mikhail Kasimov

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.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel