[systemd-devel] Antw: [EXT] Re: Q: Start a unit n minutes after a successful boot

Ulrich Windl Ulrich.Windl at rz.uni-regensburg.de
Tue Sep 8 09:01:52 UTC 2020


>>> Tomasz Torcz <tomek at pipebreaker.pl> schrieb am 08.09.2020 um 09:58 in
Nachricht
<20200908075833.GA46371 at mother.pipebreaker.pl>:
> On Tue, Sep 08, 2020 at 09:21:02AM +0200, Ulrich Windl wrote:
>> Hi!
>> 
>> Configuring a new system with non‑redundant system disk I'm wondering:
>> How could I start an automatic backup job that is triggered n minutes
>> after the system started successfully (to avoid backing up broken
>> configurations)?
> 
>   Timer with "OnBootSec=n minutes" is exactly what you want, right? 

Hi!

Is every boot a successful boot? Will (e.g.) default.target be reached even if
some service failed? If not, that is what I had in mind:
Start a unit n minutes after default.target was reached "sucessfully".

> 
> For judging if boot was successfull there are different approaches.
> On my Fedora I see user unit with timer activating after 2 minutes. 
> If user session lasted for that long, then
> ExecStart=/usr/sbin/grub2‑set‑bootflag boot_success
> is invoked. There were some discussion on this mailinglist how to
> improve detection and marking of good boot..

Assuming a good boot is a boot that lasts at least 2 minutes is silently
assuming that some human will reboot before if the boot was not sucessful?

Regards,
Ulrich

> 
> ‑‑ 
> Tomasz Torcz                        Once you've read the dictionary,
> tomek at pipebreaker.pl                every other book is just a remix.
> _______________________________________________
> systemd‑devel mailing list
> systemd‑devel at lists.freedesktop.org 
> https://lists.freedesktop.org/mailman/listinfo/systemd‑devel 





More information about the systemd-devel mailing list