Re: [systemd-devel] Newbie question - Requires doesn't work properly

2013-11-22 Thread David Timothy Strauss
On Fri, Nov 22, 2013 at 10:24 PM, Reindl Harald wrote: > your internal checks are mostly theory because in case of > a bug you have undefined behavior and what you want to achieve > with the watchdog is catch this undefined behavior and restart > the service - in doubt this will not work in the ra

Re: [systemd-devel] Newbie question - Requires doesn't work properly

2013-11-22 Thread Reindl Harald
Am 22.11.2013 12:49, schrieb David Timothy Strauss: > It is the responsibility of whatever sends the watchdog to ensure > everything's healthy, however necessary. It would > be silly to spawn a thread and have it blindly report health to watchdog. The > point is for that thread to do proper > c

Re: [systemd-devel] Newbie question - Requires doesn't work properly

2013-11-22 Thread David Timothy Strauss
It is the responsibility of whatever sends the watchdog to ensure everything's healthy, however necessary. It would be silly to spawn a thread and have it blindly report health to watchdog. The point is for that thread to do proper checks but ensure reports go in at the right intervals. On Nov 22,

Re: [systemd-devel] Newbie question - Requires doesn't work properly

2013-11-22 Thread Reindl Harald
Am 22.11.2013 03:04, schrieb salil GK: > Thanks a lot David > > On 22 November 2013 06:44, David Timothy Strauss > wrote: > > On Thu, Nov 21, 2013 at 4:57 PM, salil GK > wrote: > > What happens is - my process may be busy with som

Re: [systemd-devel] Newbie question - Requires doesn't work properly

2013-11-20 Thread salil GK
Thanks David The trick you suggested for point 3 may not work in my case. What happens is - my process may be busy with some other activity during which time it will fail to send periodic message to systemd. After a while it will come out of it's loop and ready to serve. But during this time syste

Re: [systemd-devel] Newbie question - Requires doesn't work properly

2013-11-20 Thread David Timothy Strauss
On Thu, Nov 21, 2013 at 4:33 PM, salil GK wrote: > 3. One more use case I can think of is - if the process fail to send > heartbeat message ( WATCHDOG ) for some time and later it starts sending - > because of some time. So during the time WATCHDOG notification is missing > process can be mark

Re: [systemd-devel] Newbie question - Requires doesn't work properly

2013-11-20 Thread salil GK
Thanks David and Zbyszek Yes with BindsTo parameter it works David I was trying out the options in the unit file hence PID parameter came in. I forgot to remove that later :-( some more questions in the same thread - 1. How do I trace the heartbeat message - or rather can I capture th

Re: [systemd-devel] Newbie question - Requires doesn't work properly

2013-11-20 Thread David Timothy Strauss
The service configuration is strange. Normally, this is how they work with dependencies: * Type=simple considers the service started immediately on exec() with no respect for PIDFiles or sd_notify. This can cause dependent services to come up too early. * Type=forking considers the service start

Re: [systemd-devel] Newbie question - Requires doesn't work properly

2013-11-20 Thread Zbigniew Jędrzejewski-Szmek
On Wed, Nov 20, 2013 at 07:09:13PM +0530, salil GK wrote: > Hello > > I am pretty new to systemd. > I am trying to write two dependent services Myservice and MyserviceTwo. > > *Myservice.service* > > *[Unit]* > *Description=This is a test service* > > *[Service]* > *PIDFile=/var/run/Myservi

[systemd-devel] Newbie question - Requires doesn't work properly

2013-11-20 Thread salil GK
Hello I am pretty new to systemd. I am trying to write two dependent services Myservice and MyserviceTwo. *Myservice.service* *[Unit]* *Description=This is a test service* *[Service]* *PIDFile=/var/run/Myservice.pid* *ExecStartPre=/bin/rm -f /tmp/log.log* *#ExecStartPre=/usr/bin/systemctl s