Re: [systemd-devel] How to properly write an umbrella unit

2015-07-24 Thread Krzysztof Kotlenga
Lennart Poettering wrote: Daurnimator wrote: Lennart Poettering wrote: Maybe we can change the manager core to propagate Reload() calls for unit type that do not support it natively to other units listed in PropagateReloadsTo= and then become a NOP. Or in other words: invoking reload on a

Re: [systemd-devel] How to properly write an umbrella unit

2015-07-24 Thread Lennart Poettering
On Fri, 24.07.15 11:07, Krzysztof Kotlenga (k.kotle...@sims.pl) wrote: Unfortunately one cannot specify ConsistsOf in a unit file, which is a really annoying limitation. That limitation exists for a reason: systemd loads unit files lazily: only units that are referenced by some other unit are

Re: [systemd-devel] How to properly write an umbrella unit

2015-07-24 Thread Krzysztof Kotlenga
Lennart Poettering wrote: On Fri, 24.07.15 11:07, Krzysztof Kotlenga (k.kotle...@sims.pl) wrote: Unfortunately one cannot specify ConsistsOf in a unit file, which is a really annoying limitation. That limitation exists for a reason: systemd loads unit files lazily: only units that are

Re: [systemd-devel] How to properly write an umbrella unit

2015-07-22 Thread Michael Biebl
2015-07-22 19:15 GMT+02:00 Lennart Poettering lenn...@poettering.net: On Tue, 21.07.15 13:43, Marc Haber (mh+systemd-de...@zugschlus.de) wrote: Can I write my nifty.target as a service? I have seen in this case nifty.service files with Exec=/bin/true to basically create a no-op service, but

Re: [systemd-devel] How to properly write an umbrella unit

2015-07-22 Thread Lennart Poettering
On Tue, 21.07.15 13:43, Marc Haber (mh+systemd-de...@zugschlus.de) wrote: Hi, I am trying to systemd'ize a daemon which is useful to be run in two instances. It is usually the case that both instances need to be started and stopped simultaneously, and the local admin would want a _single_

Re: [systemd-devel] How to properly write an umbrella unit

2015-07-22 Thread Lennart Poettering
On Wed, 22.07.15 20:28, Michael Biebl (mbi...@gmail.com) wrote: 2015-07-22 19:15 GMT+02:00 Lennart Poettering lenn...@poettering.net: On Tue, 21.07.15 13:43, Marc Haber (mh+systemd-de...@zugschlus.de) wrote: Can I write my nifty.target as a service? I have seen in this case nifty.service

Re: [systemd-devel] How to properly write an umbrella unit

2015-07-22 Thread Marc Haber
On Tue, Jul 21, 2015 at 09:42:38PM +0200, Michael Biebl wrote: Have a look at the openvpn package in Debian. It implements something like you have in mind. There are multiple openvpn@.service instances and a single openvpn.service which can be used by the admin to start/stop/restart them.

Re: [systemd-devel] How to properly write an umbrella unit

2015-07-22 Thread Lennart Poettering
On Thu, 23.07.15 10:41, Daurnimator (q...@daurnimator.com) wrote: On 23 July 2015 at 04:41, Lennart Poettering lenn...@poettering.net wrote: Maybe we can change the manager core to propagate Reload() calls for unit type that do not support it natively to other units listed in

Re: [systemd-devel] How to properly write an umbrella unit

2015-07-22 Thread Daurnimator
On 23 July 2015 at 04:41, Lennart Poettering lenn...@poettering.net wrote: Maybe we can change the manager core to propagate Reload() calls for unit type that do not support it natively to other units listed in PropagateReloadsTo= and then become a NOP. Or in other words: invoking reload on a

Re: [systemd-devel] How to properly write an umbrella unit

2015-07-21 Thread Michael Biebl
Have a look at the openvpn package in Debian. It implements something like you have in mind. There are multiple openvpn@.service instances and a single openvpn.service which can be used by the admin to start/stop/restart them. 2015-07-21 13:43 GMT+02:00 Marc Haber mh+systemd-de...@zugschlus.de:

Re: [systemd-devel] How to properly write an umbrella unit

2015-07-21 Thread Marc Haber
On Tue, Jul 21, 2015 at 02:20:39PM +0100, Dimitri John Ledkov wrote: And then people can do e.g.: systemctl enable nifty@4.service nifty@6.service systemctl start nifty@*.service systemctl stop nifty@*.service As I mentioned in my original mail, this is explictly not wanted, as most users

[systemd-devel] How to properly write an umbrella unit

2015-07-21 Thread Marc Haber
Hi, I am trying to systemd'ize a daemon which is useful to be run in two instances. It is usually the case that both instances need to be started and stopped simultaneously, and the local admin would want a _single_ command to start and stop both instances. Therefore, an umbrella is needed. As a

Re: [systemd-devel] How to properly write an umbrella unit

2015-07-21 Thread Alexandre Detiste
Le mardi 21 juillet 2015, 13:43:48 Marc Haber a écrit : This works as designed. Unfortunately, my Distribution's build tools don't handle package-provided targets too well, and I feel that using a target here is kind of wrong anyway. Hi, Package-provided targets works well, but by default

Re: [systemd-devel] How to properly write an umbrella unit

2015-07-21 Thread Marc Haber
On Tue, Jul 21, 2015 at 01:40:31PM +0100, Colin Guthrie wrote: In this case, I'd perhaps recommend NOT including [Install] sections fir your two .service files and instead make your make install action write symlinks into /usr/lib/systemd/system/nifty.target.wants.d/ thus the user could never

Re: [systemd-devel] How to properly write an umbrella unit

2015-07-21 Thread Marc Haber
Hi Alexandre, thanks for your fast answer and correctly guessing my Distribution ,-) On Tue, Jul 21, 2015 at 02:13:12PM +0200, Alexandre Detiste wrote: Le mardi 21 juillet 2015, 13:43:48 Marc Haber a écrit : This works as designed. Unfortunately, my Distribution's build tools don't handle

Re: [systemd-devel] How to properly write an umbrella unit

2015-07-21 Thread Colin Guthrie
Marc Haber wrote on 21/07/15 12:43: Hi, I am trying to systemd'ize a daemon which is useful to be run in two instances. It is usually the case that both instances need to be started and stopped simultaneously, and the local admin would want a _single_ command to start and stop both

Re: [systemd-devel] How to properly write an umbrella unit

2015-07-21 Thread Dimitri John Ledkov
Heya, On 21 July 2015 at 12:43, Marc Haber mh+systemd-de...@zugschlus.de wrote: Hi, I am trying to systemd'ize a daemon which is useful to be run in two instances. It is usually the case that both instances need to be started and stopped simultaneously, and the local admin would want a