[systemd-devel] How to exclusively toggle between two systemd instances of a single daemon?

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Wed Oct 8 07:05:48 PDT 2014


On Wed, Oct 08, 2014 at 06:45:48AM -0700, terrygalant.lists at fastest.cc wrote:
> Hi Zbigniew
> 
> On Wed, Oct 8, 2014, at 06:39 AM, Zbigniew Jędrzejewski-Szmek wrote:
> > You can also make a symlink from /etc/systemd/system/xxx.service to
> > either of the two files and manage it by hand, calling systemctl
> > daemon-reload afterwards. I think this should work.
> > 
> > > If other systemd units have a Requires= dependency on this daemon, how do I deal with the toggle?  Is there a "Require=this-instance-OR-that-instance" equivalent?
> > No.
> 
> 
> I think then this is the right, or only?, way to deal with the toggle AND handle the Requires=.
> 
> Set the other units' dependency to the **symlink**'s name
The symlink is supposed to have the same name as the symlink target.

> 
>    Requires=xxx.service
> 
> then manually change the symlink source AND daemon-reload to effect the toggle.
Yes.

Zbyszek


More information about the systemd-devel mailing list