How can you differentiate behavior between stop and stop as part of restart?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've come up to a problem that I haven't been able to figure out how to solve. I have a well behaved daemon process that manages its own children and has both the ability to gracefully reload it's config and gracefully restart. A graceful restart would work best by starting a new parent and then signalling the old parent which would exit once the children complete any in-process requests.

Restart as stop && start is close enough for my use case but in order to ensure the new parent process starts without waiting for the graceful stop to complete I had to set "KillMode=none" and explicitly add the "default" "ExecStop=/bin/kill -s QUIT $MAINPID" to the unit file.

This behaves as expected and restarts are fast enough for my needs.

HOWEVER, I would like stop to wait for all of the children to gracefully exit should stop be called explicitly and/or as part of system shutdown/reboot.

I see some long past discussion about adding supporting for ExecRestart which could theoretically solve the problem but I figure I'm stuck thinking about it the wrong way.

What's the systemd canonical way to set get the desired behavior?

--
kelsey.cummings@xxxxxxxxx                 sonic.net, inc.
System Architect                          2260 Apollo Way
707.522.1000                              Santa Rosa, CA




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux