Re: [systemd-devel] a problem about the order of service shudown in systeamd
Am 18.09.2015 um 11:51 schrieb lucien xin: On Fri, Sep 18, 2015 at 5:11 PM, Reindl Haraldwrote: Am 18.09.2015 um 11:03 schrieb lucien xin: is there a options that can define some common shutdown/boot order priority? not through dependence( After= and Before= you mentioned). no, and it makes no sense at all wether servcies are dpending on each other then you need to define dependencies and if they are not they don't need to be ordered and can start in parallel for example, A.service maybe 5, network.target and teamd are 1, the service whose order priority is 4 will be shudown earlier than that priority is 1. that would be unmanageable because it interfers with Before/After/Requires and at the end of the day you have conflicts or no idea what is schedlued how and why okay, as to the case I mentioned, if A.service want to be shutdown before teamd, the only way is to configure After=/Before= options in A.serivce, right? yes while it make sno difference if you define Before= in one unit or After= in the other, if a service at shutdown should be stopped before another one it needs just to be startet afterward at boot and it makes sense * something needs networking * so it is started after networking at boot * well, it is hence implicit stopped before network at shutdown * otherwise it may hang because it does some network operation at stop while network is no longer there * that's why it are dependencies which also means one needs the other signature.asc Description: OpenPGP digital signature ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] a problem about the order of service shudown in systeamd
On Fri, Sep 18, 2015 at 10:44 AM, lucien xinwrote: > I have some services which need to start after "network.target", and > shutdown before "network.target". but systemd didn't know "teamd" also > belongs to "network.target", so it won't shutdown the service before > "teamd". > > to workaround it, I need to define "After=teamd@team0.service > teamd@team1.service" to the affected service. but that seems > really stupid. are there better ways so if the service require > "network.target", systemd will shutdown it before teamd? > > is there a way to make "teamd" belongs to "network.target", or > another way to meet that requirement? > Just order teamd before network.target ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] a problem about the order of service shudown in systeamd
On Fri, Sep 18, 2015 at 3:55 PM, Andrei Borzenkovwrote: > On Fri, Sep 18, 2015 at 10:44 AM, lucien xin wrote: >> I have some services which need to start after "network.target", and >> shutdown before "network.target". but systemd didn't know "teamd" also >> belongs to "network.target", so it won't shutdown the service before >> "teamd". >> >> to workaround it, I need to define "After=teamd@team0.service >> teamd@team1.service" to the affected service. but that seems >> really stupid. are there better ways so if the service require >> "network.target", systemd will shutdown it before teamd? >> >> is there a way to make "teamd" belongs to "network.target", or >> another way to meet that requirement? >> > > Just order teamd before network.target sorry, I cannot follow you. I mean, now my A.service is shutdown before network.target. but I also wnat A.service to be shutdown before teamd, define "After=teamd@team0.service teamd@team1.service" in A.service can work, but I hope there is another way, like there may be another option can make A.service's shutdown 'level' earlier than both teamd and network.target's shutdown 'level' i do not know, just ask. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] a problem about the order of service shudown in systeamd
Am 18.09.2015 um 10:34 schrieb lucien xin: Just order teamd before network.target sorry, I cannot follow you. After=network.target I mean, now my A.service is shutdown before network.target. but I also wnat A.service to be shutdown before teamd, define "After=teamd@team0.service teamd@team1.service" in A.service can work, but I hope there is another way, like there may be another option can make A.service's shutdown 'level' earlier than both teamd and network.target's shutdown 'level' i do not know, just ask services are stopped in the reverse order they are started and so with After= and Before= you just need to adjust the order you want signature.asc Description: OpenPGP digital signature ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] a problem about the order of service shudown in systeamd
On Fri, Sep 18, 2015 at 12:03 PM, lucien xinwrote: > > is there a options that can define some common shutdown/boot order > priority? not through dependence( After= and Before= you mentioned). > > for example, A.service maybe 5, network.target and teamd are 1, the > service whose order priority is 4 will be shudown earlier than that > priority is 1. No. It is assumed that if service does not declare dependency on another service both can be started concurrently. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] a problem about the order of service shudown in systeamd
> > yes > > while it make sno difference if you define Before= in one unit or After= in > the other, if a service at shutdown should be stopped before another one it > needs just to be startet afterward at boot > > and it makes sense > > * something needs networking > * so it is started after networking at boot > * well, it is hence implicit stopped before network at shutdown > * otherwise it may hang because it does some network operation > at stop while network is no longer there > * that's why it are dependencies which also means one needs the other > > then, about this bug, https://bugzilla.redhat.com/show_bug.cgi?id=1264175 it's a special case do you have any idea what we can do in teamd.service to avoid this issue? ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] a problem about the order of service shudown in systeamd
On Fri, Sep 18, 2015 at 5:11 PM, Reindl Haraldwrote: > > > Am 18.09.2015 um 11:03 schrieb lucien xin: >> >> is there a options that can define some common shutdown/boot order >> priority? not through dependence( After= and Before= you mentioned). > > > no, and it makes no sense at all > > wether servcies are dpending on each other then you need to define > dependencies and if they are not they don't need to be ordered and can start > in parallel > >> for example, A.service maybe 5, network.target and teamd are 1, the >> service whose order priority is 4 will be shudown earlier than that >> priority is 1. > > > that would be unmanageable because it interfers with Before/After/Requires > and at the end of the day you have conflicts or no idea what is schedlued > how and why > > okay, as to the case I mentioned, if A.service want to be shutdown before teamd, the only way is to configure After=/Before= options in A.serivce, right ? ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] a problem about the order of service shudown in systeamd
I have some services which need to start after "network.target", and shutdown before "network.target". but systemd didn't know "teamd" also belongs to "network.target", so it won't shutdown the service before "teamd". to workaround it, I need to define "After=teamd@team0.service teamd@team1.service" to the affected service. but that seems really stupid. are there better ways so if the service require "network.target", systemd will shutdown it before teamd? is there a way to make "teamd" belongs to "network.target", or another way to meet that requirement? Thanks ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] a problem about the order of service shudown in systeamd
On Fri, Sep 18, 2015 at 11:44 AM, Reindl Haraldwrote: > > > Am 18.09.2015 um 10:34 schrieb lucien xin: >>> >>> Just order teamd before network.target >> >> >> sorry, I cannot follow you. > > > After=network.target > Actually I meant that teamd should have Before=network.target Then anything ordered after network.target will be stopped early enough. >> I mean, now my A.service is shutdown before network.target. >> but I also wnat A.service to be shutdown before teamd, >> define "After=teamd@team0.service teamd@team1.service" >> in A.service can work, but I hope there is another way, >> >> like there may be another option can make A.service's shutdown >> 'level' earlier than both teamd and network.target's shutdown 'level' >> >> i do not know, just ask > > > services are stopped in the reverse order they are started and so with > After= and Before= you just need to adjust the order you want > > > ___ > systemd-devel mailing list > systemd-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/systemd-devel > ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] a problem about the order of service shudown in systeamd
On Fri, Sep 18, 2015 at 4:44 PM, Reindl Haraldwrote: > > > Am 18.09.2015 um 10:34 schrieb lucien xin: >>> >>> Just order teamd before network.target >> >> >> sorry, I cannot follow you. > > > After=network.target > >> I mean, now my A.service is shutdown before network.target. >> but I also wnat A.service to be shutdown before teamd, >> define "After=teamd@team0.service teamd@team1.service" >> in A.service can work, but I hope there is another way, >> >> like there may be another option can make A.service's shutdown >> 'level' earlier than both teamd and network.target's shutdown 'level' >> >> i do not know, just ask > > > services are stopped in the reverse order they are started and so with > After= and Before= you just need to adjust the order you want > > okay, I got you, thanks. is there a options that can define some common shutdown/boot order priority? not through dependence( After= and Before= you mentioned). for example, A.service maybe 5, network.target and teamd are 1, the service whose order priority is 4 will be shudown earlier than that priority is 1. something like that. I do not know if the dependence is the only way to define the shudown/boot order. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel