I would like to use one .service file for starting a service from varying directories but it would be nice if there was a way to automatically stop any running instance with a different instance name (or even the same) or at least to prevent starting a second instance.Say I have a unit file special_service@.service that containsWorkingDirectory=/var/special_service/%iand then call systemctl start special_service@try_one and later I issue systemctl start special_service@try_two then this second instance should either fail to start with an appropriate message or even better stop special_service@try_one and start special_service@try_two.
Is there a way to make sure only one systemd@.service instance is running resp. gets started
systemd