I would like to have several
systemd targets, call them
TargetC, that control a set of services, call them
Service7. The configuration would look something like this:
- Only one target should be allowed to be enabled at a time
- The system administrator should be able to manually start and services at will
My initial setup involved:
- Each target conflicted with the other two targets
- Every service had
This met the first requirement. Starting
TargetX stopped the other two targets. Unfortunately, this setup restricted the sysadmin. If the sysadmin ran
sudo systemctl start ServiceX the service would launch and then immediately die because it wasn't needed.
My second setup involved:
- Every target conflicted with the other two targets
- Every target also conflicted with the services that it didn't need
- No service has
This doesn't have the desired effect. If I run:
sudo systemctl start TargetA.target
sudo systemctl start TargetB.target
TargetA.target is stopped (yay!) but
Service2 are still running.
What am I not getting? How can I get the
systemd behavior that I'm looking for?