Re: Systemd migration: opinion and questions

Rich Freeman <[email protected]> Sun, 1 Mar 2015 08:34:19 -0500
Newsgroups gmane.linux.gentoo.amd64
Message-ID <CAGfcS_mYKZz-5nasgsam0eR4doxka_F1ep6ZC1_LUgzotDYMEQ@mail.gmail.com>
On Sun, Mar 1, 2015 at 7:48 AM, Marc Joliet <[email protected]> wrote:
>
> The problem with conditions (as they exist in systemd currently) is the same as
> with dependencies: the unit does not wait until the condition is met, but
> immediately stops (only that it doesn't enter a failed state).  I mean, this is
> what conditions in systemd are *supposed* to do, and they do they're
> designated job, but I would like the timer to wait until the condition is met
> and *then* run the job. I.e., I want a *delay*.

The timer keeps running if you set the dependency on the service.  So,
next time the timer runs, it will try again.  You might want to just
set an hourly job and have it check for a successful run in the last
day or whatever.

I don't know if restart=on-failure or on-abnormal applies if the
service fails to run in the first place.  You might try setting that
with a suitable restartsec=### setting.  That might be a better way to
get the behavior you want if it works.

-- 
Rich