Re: [systemd-devel] Create a target unit to start & stop a group of services

2018-03-08 Thread 林自均
Hi Zbyszek, Thank you for your explanation. However, I found that Conflicts= will be a good choice for me: # /etc/systemd/system/my-apps-start.target [Unit] Wants=docker.service sshd.service mongodb.service # /etc/systemd/system/my-apps-stop.target [Unit]

Re: [systemd-devel] Create a target unit to start & stop a group of services

2018-03-07 Thread Zbigniew Jędrzejewski-Szmek
On Tue, Mar 06, 2018 at 03:07:30AM +, 林自均 wrote: > Anyone? > > John Lin > > 林自均 於 2018年2月27日 週二 下午6:20寫道: > > > Hi Jérémy, > > > > Thank you, but I read the section "Mapping of unit properties to their > > inverses" in the man page > >

Re: [systemd-devel] Create a target unit to start & stop a group of services

2018-03-05 Thread 林自均
Anyone? John Lin 林自均 於 2018年2月27日 週二 下午6:20寫道: > Hi Jérémy, > > Thank you, but I read the section "Mapping of unit properties to their > inverses" in the man page > https://www.freedesktop.org/software/systemd/man/systemd.unit.html and > then found out the

Re: [systemd-devel] Create a target unit to start & stop a group of services

2018-02-27 Thread 林自均
Hi Jérémy, Thank you, but I read the section "Mapping of unit properties to their inverses" in the man page https://www.freedesktop.org/software/systemd/man/systemd.unit.html and then found out the PropagatesReloadTo= and ReloadPropagatedFrom= are inverses to each other and both can be configured

Re: [systemd-devel] Create a target unit to start & stop a group of services

2018-02-27 Thread Jérémy Rosen
On 27/02/2018 02:49, 林自均 wrote: Hi both Michal, Thank you for the quick responses! I think I will keep on using the tedious PartOf= directive. However, may I ask why ConsistsOf= is readonly? If I can use it in my "my-apps.target", that would be great. Because "ConsistsOf" doesn't exist in

Re: [systemd-devel] Create a target unit to start & stop a group of services

2018-02-26 Thread 林自均
Hi both Michal, Thank you for the quick responses! I think I will keep on using the tedious PartOf= directive. However, may I ask why ConsistsOf= is readonly? If I can use it in my "my-apps.target", that would be great. John Lin Michal Koutný 於 2018年2月26日 週一 下午7:28寫道: > > >

Re: [systemd-devel] Create a target unit to start & stop a group of services

2018-02-26 Thread Michal Koutný
On 02/26/2018 11:08 AM, Michal Sekletar wrote: > Unfortunately, we don't have a dependency (AFAIK) that only propagates > stop actions. FTR (not helpful for the original problem), there exists ConsistsOf= as an inverse of PartOf= dependency. However, it's read only currently (or strictly

Re: [systemd-devel] Create a target unit to start & stop a group of services

2018-02-26 Thread Michal Sekletar
On Mon, Feb 26, 2018 at 10:24 AM, 林自均 wrote: > However, it is a little bit tedious to write drop-ins for each service > units. Is there a directive for "my-apps.target" to propagate "stop" > operation to the 3 services? I was expecting something like >