Re: How to only allow service to start when network-online.target is met?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On this date - Tue, Sep 17, 2019 at 06:35:34PM +0300, Mantas Mikulėnas wrote:
> On Tue, Sep 17, 2019 at 5:53 PM Dom Rodriguez <shymega@xxxxxxxxxxxxxx>
> wrote:
> 
> > Hello,
> >
> > I've got a service unit, which is linked to a timer unit, and I'd like to
> > have
> > the behaviour associated with `Condition=` directives, but for targets. To
> > explain further, my desired expectation is for the service unit to *only*
> > start
> > when the target is active. Ideally, I don't want the service unit to fail
> > either, but have similar behaviour with `Condition=`, which doesn't mark
> > the
> > unit as failed, but merely not meeting condition(s).
> >
> 
> Have a service ordered after network-online which creates a flag file under
> /run, then use "ConditionPathExists=/run/already-online.flag".
> 
> -- 
> Mantas Mikulėnas

That worked perfectly. Problem solved!

Thanks.

-- 
Sincerely,
Dom Rodriguez (shymega).

_______________________________________________
systemd-devel mailing list
systemd-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/systemd-devel




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux