I have two systemd services application.service and feh@.service. application.service is enabled and usually running. feh@.service is not enabled and started only manually and has a Conflicts=application.service entry.

I want to achieve, that if application.service is running and I start an instance of feh@.service, that application service terminates. This is currently working due to the Conflicts=application.service entry mentioned above.

However, a data synchronization service periodically restarts application.service via systemctl restart application.service remotely. I would like this to fail if, and only if, feh@.service is running. Currently this will shutdown the feh@.service instance and start application.service. I could not find anything related to this in the official documents of systemd.

Background info:

I cannot let the remote service check for feh@.service because this only exists on a few machines (it is an exceptional configuration) and is not part of the usual infrastructure. I also do not want to stop the service, since it also controls other devices that may not run feh@.service.

1 Answer 1


We had very similar problem; I would consider this response as the way to solve it; also I would test After= and Before= using ExecStartPre=

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.