We have an issue with some of our configuration management tools where
daemon-reload and daemon-reexec are necessary for updated service units.
Unfortunately, running either briefly interferes with normal service
manipulation commands like start, stop, and restart. A tool running on the
wrong side of a daemon-reload ends up thinking the service it was working
with is broken.

It's possible to retry a systemctl start, etc. command multiple times if a
daemon-reload is running, but it's kind of dirty.

I figured it's worth sharing this Gist of a Python script I wrote to
smartly wrap systemctl. It takes out a shared lock for normal commands and
an exclusive one for daemon-* commands. This causes normal commands to wait
on completion of daemon-* before attempting service manipulation. I don't
recommend using this to replace the normal systemctl command globally, but
it is a good drop-in when you have multiple tools that might cause each
other problems as I described above.

Here's the code: https://gist.github.com/2488169
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to