[systemd-devel] how to start a service when another sevice stops

Khem Raj raj.khem at gmail.com
Fri Nov 30 18:52:37 PST 2012


On Fri, Nov 30, 2012 at 3:53 PM, David Strauss <david at davidstrauss.net>wrote:

> On Fri, Nov 30, 2012 at 2:28 PM, Khem Raj <raj.khem at gmail.com> wrote:
> > I have a scenario where, I have foo.service which runs on boot and later
> > bar.service runs and it has to stop foo.service which I achieved by
> > declaring it as Conflicts= in the unit file but I would like to restart
> > foo.service when bar.service is stopped. I have run out of ideas on how
> to
> > achieve that. I am looking for help
>
> It's intentionally not supported, but it has been proposed in some
> recent patches. I think it was proposed as OnStop= or OnShutdown=.
>
> Reindl's suggestion will probably do what you want, but systemd won't
> consider the stopping of the first service and the starting of the
> second a transaction.
>


Hi David

yeah OnStop= and/or OnShutdown= is something that will solve my problem
exactly
Reindl's suggest I have already tried, it does not work.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20121130/4c55523c/attachment.html>


More information about the systemd-devel mailing list