Systemd must provide an option in Unit configuration to indicate a template to be singleton. There are use cases where a template should have only one instance at a time, and whenever it is instantiated, the existing instance must be stopped first. My own case is described in this question on Stackoverflow: http://stackoverflow.com/questions/30208805/systemd-how-to-write-a-singleton-unit-template
Hmm? I am not sure I get what you want: templates and instances are concepts we introduced to allow multiple instances of services, and they only exist for that reason. Before we had them, every unit was a singleton. Hence: if you want a singleton, then simply use a non-template/non-instance unit and all should be good.
Thanks for replying @Lennart . I am using Systemd to maintain a set of network adaptation scripts, meaning, for instance, to mount samba drives and switch to a certain proxy when I am in office, and to switch to my own proxy (that can bypass the Great Firewall of China) when I am in Starbucks, etc.. To group all the service units, I created a template: `network@.target`, and have several instances such as `network@office.target`, `network@home.target`, `network@starbucks.target`, `network@offline.target`, etc.. Now due to the nature of these targets, there should always be only one instance that is active. But I can't find a way to define this exclusiveness.
Closing all stale bugs with NEEDINFO. Please open a new bug at https://github.com/systemd/issues if the problem still occurs.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.