Starting a service when stopping a different one

Michael Meskes meskes at debian.org
Fri Nov 21 14:53:30 GMT 2014


Hi,

is this possible? Let's say I have services foo and bar. I can declare a
conflict which results in bar being stopped automatically when foo is started.
But what I'd need is the opposite, I'd like foo to be started automatically
when bar is stopped. Is there any way to accomblish this?

I tried calling "systemctl start" in ExecStopPost but that sometimes gets stuck
(probably why Michael advised me to not do it anyway). Starting the service by
hand (as in just running the binary) is not a solution, either, because the
systemd doesn't know about it and apparently cannot stop it, in particular when
the opposite service is started again.

The last thing I came up with was to bring bar into failed state automatically,
but I'm afraid that has unplanned side-effects.

Or in other words: HELP! :)

Michael 
-- 
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
Jabber: michael.meskes at gmail dot com
VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL



More information about the Pkg-systemd-maintainers mailing list