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

terrygalant.lists at fastest.cc terrygalant.lists at fastest.cc
Wed Oct 8 06:30:51 PDT 2014


Hi

I have 2 installed instances of a single daemon.

1 is from distro-installed packages, installed into standard default OS locations with unit files in /usr/lib/systemd/system/.

The other is installed under /opt, with unit files currently in /opt/mydaemon/systemd/system/, which can be (un)symlinked as needed into /etc/systemd/system/multi-user.target.wants/ to disable or enable.

I want to be able to occasionally toggle between use of the 2.

Is the right systemd way to do manage this toggle to just name the 2 instances' unit files differently, put a Conflicts= in each for the other, and just use 'enable' for whichever I want active?

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?

TerryG


More information about the systemd-devel mailing list