Summary: | RFE: Singleton Template | ||
---|---|---|---|
Product: | systemd | Reporter: | Sah Lee <contact> |
Component: | general | Assignee: | systemd-bugs |
Status: | RESOLVED WONTFIX | QA Contact: | systemd-bugs |
Severity: | normal | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux (All) | ||
URL: | http://stackoverflow.com/questions/30208805/systemd-how-to-write-a-singleton-unit-template | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Sah Lee
2015-05-18 10:23:33 UTC
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.