[systemd-devel] how to properly control the daemons or run advanced cmds

Richard Maw richard.maw at codethink.co.uk
Tue Nov 25 02:42:12 PST 2014


On Tue, Nov 25, 2014 at 12:09:07AM -0200, Flavio Leitner wrote:
> 
> Hello,
> 
> The Open vSwitch is comprised by two daemons. One is a database and
> another is the switch itself.
> 
> Currently we have the openvswitch.service which start/stop/reload the
> service (both daemons) just fine.
> 
> However, we need to support hot-upgrade which means to stop the
> vswitch daemon first, run a few special commands, reload the db
> daemon and only then start the vswitch daemon.
> 
> I know about creating shell helpers for non-standard commands, but
> since that needs to mess up with the daemons in a particular order,
> I think systemd won't like the above external actions at all.
> 
> Any suggestion on how to handle this with systemd properly?

We've previously had discussion on how to handle hot-upgrade, though I
don't remember enough details to find the message again.

I think the resolution was that the daemon in question must either
re-exec itself, or have NotifyAccess=all set in the systemd unit, and
it must notify systemd of the PID of the new version of the daemon by
sending MAINPID=$NEWPID with sd_notify.

Unless you overload ExecReload to mean hot-upgrade/graceful-reexec then
you'll have to have an external tool instruct the service to upgrade
itself, rather than issuing a `systemctl reload vswitch.service`.


More information about the systemd-devel mailing list