Previously, WSGI server systemd unit files might have used something like
ExecReload=kill -USR1 $MAINPID
This was risky; in the related change, reloads were made safer, but
required more than one ExecReload line. Meanwhile, systemd docs
(https://www.freedesktop.org/software/systemd/man/systemd.service.html#ExecReload=)
say
> It is strongly recommended to set ExecReload= to a command that
> not only triggers a configuration reload of the daemon, but also
> synchronously waits for it to complete.
which *neither* set of ExecReloads would do.
Now, add a new swift-reload command which, given a pid,
* validates that the PID seems to belong to a Swift WSGI server
manager process,
* checks that the config used by that PID is still valid,
* signals the PID to perform a seamless reload, and
* waits for the reload to complete by monitoring the PID's children.
As a result, WSGI server systemd unit files can now use something like
ExecReload=swift-reload $MAINPID
to follow systemd recommendations.
Change-Id: Ifcadd2f8427f107aae1921cdd311f7973b0312e1
Related-Change: I9e5e158ce8be92535430b9cabf040063f5188bf4