1

Some time ago, I created a systemd timer using the command:

systemd-run --on-calendar='*-*-01 12:00:00' --description='Update root hints for unbound' --property='After=network.target' --timer-property='Persistent=true' /usr/bin/curl -o /etc/unbound/root.hints https://www.internic.net/domain/named.cache

After creating this timer, it was assigned a random name run-u1021.

Fast-forward to today, I wanted to see the status of the timer so I run the command:

systemctl list-timers --all

It is not listed in there.

I checked /var/lib/systemd/timers/, to see that it contains a stamp file with the name stamp-run-u1021.timer.

Running stat on this file shows that it was last modified 2020-05-09, which also corresponds to the stat information for the file /etc/unbound/root.hints.

➜ stat /var/lib/systemd/timers/stamp-run-u1021.timer
  File: /var/lib/systemd/timers/stamp-run-u1021.timer
  Size: 0           Blocks: 0          IO Block: 4096   regular empty file
Device: 803h/2051d  Inode: 9438418     Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2020-05-09 23:40:46.628653123 -0600
Modify: 2020-05-09 23:40:46.628653123 -0600
Change: 2020-05-09 23:40:46.628653123 -0600
 Birth: 2020-05-09 23:40:46.628653123 -0600

So this timer has been run atleast once, but my question is, where is it located? And how come systemd does not show it? Is that something to do with the way it was created?


The next run of the timer:

➜ systemd-analyze calendar '*-*-01 12:00:00'               
Normalized form: *-*-01 12:00:00            
    Next elapse: Mon 2020-06-01 12:00:00 CST
       (in UTC): Mon 2020-06-01 18:00:00 UTC
       From now: 1 day 22h left

Shows that the timer will be activated in less than 2 days from now. I will wait and see if it actually activates, but in the meanwhile, if someone can answer where the transient timer and its service was created, that would be helpful.

I have also taken a look at this question: Removing a timer created with "systemd-run --on-calendar" However, their problem is different in that systemd actually shows the timer, but they are just having a hard time removing it. In my case, the timer is not showing up in systemd, but still seems to be alive.

4
  • uptime? the analyze command is generic and does not imply existence of any timer. May 30, 2020 at 22:32
  • @frostschutz running the uptime command: 16:59:05 up 5:34, 1 user, load average: 2.53, 1.74, 1.42
    – smac89
    May 30, 2020 at 23:00
  • You are aware that systemd-run transient timers/units do not survive reboots? May 31, 2020 at 9:58
  • @frostschutz that's exactly what I was trying to understand. Thank you. I kept reading the docs and no where does it mention this.
    – smac89
    May 31, 2020 at 14:27

0

You must log in to answer this question.

Browse other questions tagged .