Sietse, thanks a lot for suggestions. I will give a try and test it.
On Thu, Aug 30, 2018 at 5:24 PM Sietse van Zanen <sie...@wizdom.nu> wrote: > Hi Rajat, > > > PropagateReload should indeed only effect reloads of units, not stops or > starts, that's what bindsto and partof are for. Systemd should protect > against reload loops, but it may also give an error. I have not used this > situation myself so test it. > > > -Sietse > > > ________________________________ > From: rajat rastogi <rajat1.i...@gmail.com> > Sent: Thursday, August 30, 2018 11:24 > To: Sietse van Zanen > Cc: systemd-devel@lists.freedesktop.org > Subject: Re: [systemd-devel] [Need Help]: What Systemd service directives > to use > > Hi Sietse, > > Thanks for reply. > > So if use mentioned directives as below > > A.service file > ------------------ > > PropagatesReloadTo=B > > B.service file > ---------------- > > PropagatesReloadTo=A > > Will not it create a loop? If yes, how to avoid it. > > I will re-phrase the requirements: > > 1. If process A is restarted then B should also be restarted > > 2. If process B is restarted then A should also be restarted > > 3. If process A is stopped then B should not be stopped > > 4. If process B is stopped then B should not be stopped > > For the above requirements, I want to know, what directives I need to add > to service files for A & B. > > Regards, > Rajat > > On Thu, Aug 30, 2018 at 1:19 PM Sietse van Zanen <sie...@wizdom.nu<mailto: > sie...@wizdom.nu>> wrote: > Hi Rajat, > > > Take a look at BindsTo, PartOf, PropagatesReloadTo, ReloadPropagatedFrom > and < > https://www.freedesktop.org/software/systemd/man/systemd.unit.html#PropagatesReloadTo=> > OnFailure. I think a combination of these should achieve what you want, > > https://www.freedesktop.org/software/systemd/man/systemd.unit.html#BindsTo= > < > https://www.freedesktop.org/software/systemd/man/systemd.unit.html#BindsTo > > > > > > -Sietse > > ________________________________ > From: systemd-devel <systemd-devel-boun...@lists.freedesktop.org<mailto: > systemd-devel-boun...@lists.freedesktop.org>> on behalf of rajat rastogi < > rajat1.i...@gmail.com<mailto:rajat1.i...@gmail.com>> > Sent: Thursday, August 30, 2018 09:07 > To: systemd-devel@lists.freedesktop.org<mailto: > systemd-devel@lists.freedesktop.org> > Subject: [systemd-devel] [Need Help]: What Systemd service directives to > use > > Hi, > > My name is rajat. > > I have below requirement: > > There are 2 processes A and B. > > For the mentioned processes, below behaviour is required: > > 1. If process A is restarted then B should also be restarted > > 2. If process B is restarted then A should also be restarted > > For the above-desired behaviour, what Systemd directives I should use? How > I can avoid circular dependency if any might appear? > > Thanks and Regards, > Rajat Rastogi >
_______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel