Re: [systemd-devel] Unexpecte behavior for timer with OnActiveSec

2014-11-08 Thread Andrei Borzenkov
В Fri, 7 Nov 2014 08:56:49 +
Paassen, Hiram van hiram.van.paas...@mastervolt.com пишет:

 Hi,
 
 We need to switch to a different target after 30 min of starting that target. 
 Switching happens with isolate.
 So we have a timer with OnActiveSec=30min witch starts a service that calls 
 systemctl isolate other.target
 
 This works like a charm... the first time the target is activated. The second 
 time we start that target nothing happens after 30 min.
 
 After some manual testing I can conclude that a timer with OnActiveSec set 
 will stay in elapsed state even after the timer has been restarted or stopped 
 and then started. This is not what I expect. Also there seems to be no way to 
 reset it to the waiting/running state except for the following procedure:
 
 systemctl daemon-reload
 systemctl restart timer.timer
 
 Is this expected behavior or a bug?
 

It is not a bug as far as I can tell; but timer state should be reset
when unit it triggered changes state. So you have A.target that calls
B.timer that triggers B.target. Next time A.target tries to start
B.timer - is B.target still active?

P.S. actually the fact that you can restart timer after daemon-reload
is probably a bug :)
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Unexpecte behavior for timer with OnActiveSec

2014-11-08 Thread Zbigniew Jędrzejewski-Szmek
On Sat, Nov 08, 2014 at 04:36:30PM +0300, Andrei Borzenkov wrote:
 В Fri, 7 Nov 2014 08:56:49 +
 Paassen, Hiram van hiram.van.paas...@mastervolt.com пишет:
 
  Hi,
  
  We need to switch to a different target after 30 min of starting that 
  target. Switching happens with isolate.
  So we have a timer with OnActiveSec=30min witch starts a service that calls 
  systemctl isolate other.target
  
  This works like a charm... the first time the target is activated. The 
  second time we start that target nothing happens after 30 min.
  
  After some manual testing I can conclude that a timer with OnActiveSec set 
  will stay in elapsed state even after the timer has been restarted or 
  stopped and then started. This is not what I expect. Also there seems to be 
  no way to reset it to the waiting/running state except for the following 
  procedure:
  
  systemctl daemon-reload
  systemctl restart timer.timer
  
  Is this expected behavior or a bug?
  
 
 It is not a bug as far as I can tell; but timer state should be reset
 when unit it triggered changes state. So you have A.target that calls
 B.timer that triggers B.target. Next time A.target tries to start
 B.timer - is B.target still active?
 
 P.S. actually the fact that you can restart timer after daemon-reload
 is probably a bug :)
http://cgit.freedesktop.org/systemd/systemd/commit/?id=779042e772 might be 
related.

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


[systemd-devel] Unexpecte behavior for timer with OnActiveSec

2014-11-07 Thread Paassen, Hiram van
Hi,

We need to switch to a different target after 30 min of starting that target. 
Switching happens with isolate.
So we have a timer with OnActiveSec=30min witch starts a service that calls 
systemctl isolate other.target

This works like a charm... the first time the target is activated. The second 
time we start that target nothing happens after 30 min.

After some manual testing I can conclude that a timer with OnActiveSec set will 
stay in elapsed state even after the timer has been restarted or stopped and 
then started. This is not what I expect. Also there seems to be no way to reset 
it to the waiting/running state except for the following procedure:

systemctl daemon-reload
systemctl restart timer.timer

Is this expected behavior or a bug?

Best regards,

Hiram van Paassen



Power Products, LLC Email Notice

This message is intended only for the use of the Addressee and may contain 
information that is PRIVILEGED and/or CONFIDENTIAL.
This email is intended only for the personal and confidential use of the 
recipient(s) named above. If the reader of this email is not an intended 
recipient, you have received this email in error and any review, dissemination, 
distribution or copying is strictly prohibited.
If you have received this email in error, please notify the sender immediately 
by return mail and permanently delete the copy you received.

Thank you.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel