[systemd-devel] Antw: [EXT] Re: timer "OnBootSec=15m" not triggering

Ulrich Windl Ulrich.Windl at rz.uni-regensburg.de
Mon Mar 7 11:24:51 UTC 2022


>>> Mantas Mikulenas <grawity at gmail.com> schrieb am 07.03.2022 um 10:39 in
Nachricht
<CAPWNY8WnjPy695cS2s0p781c1G3cKrenVm3trsxFi015RzCB_A at mail.gmail.com>:
> On Mon, Mar 7, 2022 at 11:22 AM Ulrich Windl <
> Ulrich.Windl at rz.uni-regensburg.de> wrote:
> 
>> Hi!
>>
>> I wrote some services that should run when booting and some time after
>> booting.
>> As it seems the service to run during boot works, but the timer-triggered
>> one
>> does not.
>> I have no idea why.
>>
>> Here are the details:
>> # systemctl status prevent-fencing-loop.service
>> ● prevent-fencing-loop.service - Prevent Pacemaker Fencing-Loop
>>      Loaded: loaded (/usr/lib/systemd/system/prevent-fencing-loop.service;
>> enabled; vendor preset: disabled)
>>      Active: inactive (dead) since Sat 2022-03-05 10:33:50 CET; 1 day 23h
>> ago
>>        Docs: man:boot-loop-handler(8)
>>    Main PID: 5226 (code=exited, status=0/SUCCESS)
>>
>> Mar 05 10:33:50 h19 systemd[1]: Starting Prevent Pacemaker Fencing-Loop...
>> Mar 05 10:33:50 h19 boot-loop-handler[5234]: 1 of 4 allowable boots
>> Mar 05 10:33:50 h19 systemd[1]: prevent-fencing-loop.service: Succeeded.
>> Mar 05 10:33:50 h19 systemd[1]: Finished Prevent Pacemaker Fencing-Loop.
>>
>> So this service ran during boot.
>>
>> # systemctl status reset-boot-counter.timer
>> ● reset-boot-counter.timer - Reset Boot-Counter after 15 minutes
>>      Loaded: loaded (/usr/lib/systemd/system/reset-boot-counter.timer;
>> enabled; vendor preset: disabled)
>>      Active: inactive (dead)
>>     Trigger: n/a
>>
> 
> It's not a problem with any of the [Timer] On* configuration – the problem
> is that the whole .timer unit isn't active, so its triggers won't get
> scheduled in the first place.
> 
> 
>> [Install]
>> WantedBy=timer.target
>>
> 
> The timer is not being scheduled because it's WantedBy a nonexistent
> target. I think you meant 'timer*s*.target' here.

Hi!

Thanks for that. The amazing things are that "systemd.analyze verify" finds no
problem and "enable" virtually succeeds, too:
# systemctl enable reset-boot-counter.timer
Created symlink
/etc/systemd/system/timer.target.wants/reset-boot-counter.timer →
/usr/lib/systemd/system/reset-boot-counter.timer.

But you are correct that the target is "timers":
# ll /etc/systemd/system/timer*
/etc/systemd/system/timer.target.wants:
total 4
lrwxrwxrwx 1 root root 48 Mar  7 12:05 reset-boot-counter.timer ->
/usr/lib/systemd/system/reset-boot-counter.timer

/etc/systemd/system/timers.target.wants:
total 40
lrwxrwxrwx 1 root root 42 Nov  6  2020 backup-rpmdb.timer ->
/usr/lib/systemd/system/backup-rpmdb.timer
lrwxrwxrwx 1 root root 46 Nov  6  2020 backup-sysconfig.timer ->
/usr/lib/systemd/system/backup-sysconfig.timer
lrwxrwxrwx 1 root root 43 Nov  6  2020 btrfs-balance.timer ->
/usr/lib/systemd/system/btrfs-balance.timer
lrwxrwxrwx 1 root root 41 Nov  6  2020 btrfs-scrub.timer ->
/usr/lib/systemd/system/btrfs-scrub.timer
lrwxrwxrwx 1 root root 43 Nov  6  2020 check-battery.timer ->
/usr/lib/systemd/system/check-battery.timer
lrwxrwxrwx 1 root root 36 Nov  6  2020 fstrim.timer ->
/usr/lib/systemd/system/fstrim.timer
lrwxrwxrwx 1 root root 39 Nov  6  2020 logrotate.timer ->
/usr/lib/systemd/system/logrotate.timer
lrwxrwxrwx 1 root root 35 Nov  9  2020 mandb.timer ->
/usr/lib/systemd/system/mandb.timer
lrwxrwxrwx 1 root root 45 Nov  6  2020 snapper-cleanup.timer ->
/usr/lib/systemd/system/snapper-cleanup.timer
lrwxrwxrwx 1 root root 46 Nov  6  2020 snapper-timeline.timer ->
/usr/lib/systemd/system/snapper-timeline.timer

Basically I shouldn't have trusted Message-ID:
<7d547aa30624f2dc8d22ea7f84507fa1d8e9c678.camel at gmx.net> ;-)

Regards,
Ulrich


> 
> -- 
> Mantas Mikulėnas





More information about the systemd-devel mailing list