0

As explained in GoAccess 1.4 detailed tutorial, I've create a goa-daily.timer

[Unit]
Description=Daily update of GoAccess reports

[Timer]
# Every day @ 3 O'clock
OnCalendar=*-*-* 03:00:00
RandomizedDelaySec=7200
Persistent=true
Unit=goa-daily.service

[Install]
WantedBy=timers.target

No matter how I define the OnCalendar option, when I check the timer status it has always a Trigger: n/a whereas all other timers have a trigger.

root@scw:/etc/systemd/system/timers.target.wants# ll
total 0
lrwxrwxrwx 1 root root 35 sep 28  2020 apt-daily.timer -> /lib/systemd/system/apt-daily.timer
lrwxrwxrwx 1 root root 43 sep 28  2020 apt-daily-upgrade.timer -> /lib/systemd/system/apt-daily-upgrade.timer
lrwxrwxrwx 1 root root 33 nov 30  2020 certbot.timer -> /lib/systemd/system/certbot.timer
lrwxrwxrwx 1 root root 35 fév 23 23:01 goa-daily.timer -> /etc/systemd/system/goa-daily.timer
lrwxrwxrwx 1 root root 35 sep 28  2020 logrotate.timer -> /lib/systemd/system/logrotate.timer
lrwxrwxrwx 1 root root 32 sep 28  2020 man-db.timer -> /lib/systemd/system/man-db.timer

root@scw:/etc/systemd/system/timers.target.wants# systemctl status goa-daily.timer 
● goa-daily.timer - Daily update of GoAccess reports
   Loaded: loaded (/etc/systemd/system/goa-daily.timer; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2022-01-31 15:43:42 UTC; 3 weeks 2 days ago
  Trigger: n/a

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
root@scw:/etc/systemd/system/timers.target.wants# systemctl status logrotate.timer 
● logrotate.timer - Daily rotation of log files
   Loaded: loaded (/lib/systemd/system/logrotate.timer; enabled; vendor preset: enabled)
   Active: active (waiting) since Tue 2022-01-04 08:00:34 UTC; 1 months 20 days ago
  Trigger: Thu 2022-02-24 00:00:00 UTC; 49min left
     Docs: man:logrotate(8)
           man:logrotate.conf(5)

Why my timer does not display any trigger? I've enabled it with: systemctl enable --now goa-daily.timer What else should I do to have running timer with a trigger? I'm on Debian 10 (buster)

Status of goa-daily.service

# systemctl status goa-daily.service
● goa-daily.service - Application
   Loaded: loaded (/etc/systemd/system/goa-daily.service; enabled; vendor preset: enabled)
   Active: active (exited) since Mon 2022-01-31 16:08:54 UTC; 3 weeks 2 days ago
 Main PID: 17337 (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 2347)
   Memory: 0B
   CGroup: /system.slice/goa-daily.service

Thanks to @fuzzy drawings comment, I notice that daemon-reload has no effect on timer change. stop and start the timer adds the trigger!

# systemctl stop goa-daily.timer 
# systemctl start goa-daily.timer 
# systemctl status goa-daily.timer 
● goa-daily.timer - Daily update of GoAccess reports
   Loaded: loaded (/etc/systemd/system/goa-daily.timer; enabled; vendor preset: enabled)
   Active: active (waiting) since Thu 2022-02-24 08:51:34 UTC; 4s ago
  Trigger: Thu 2022-02-24 08:54:00 UTC; 2min 21s left

BUT after running the timer, status displays a n/a Trigger, at least with a OnCalendar date-time definition like OnCalendar=*-*-* 08:54:00.

# systemctl status goa-daily.timer 
● goa-daily.timer - Daily update of GoAccess reports
   Loaded: loaded (/etc/systemd/system/goa-daily.timer; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2022-02-24 08:51:34 UTC; 2min 30s ago
  Trigger: n/a

What I'm missing to make it repeating each day??? I'll test with daily option and check tomorrow...

4
  • Did you run systemctl start goa-daily.timer? Commented Feb 24, 2022 at 2:25
  • 1
    What does systemctl status goa-daily.service return? Add to your question, please. Commented Feb 24, 2022 at 6:39
  • @fuzzy drawings: I've run a start on the timer but it does not change the status (trigger: n/a)
    – openHBP
    Commented Feb 24, 2022 at 8:19
  • @ajgringo619: I've added the status of goa-daily.service in the question
    – openHBP
    Commented Feb 24, 2022 at 8:20

1 Answer 1

1

From the display of the service the status is active. I believe your timer won't trigger a running service unit. It may be that the service unit failed for some reason but system doesn't know or it has been coded to remain as active after ending.

1
  • Indeed I think that was the issue. I'll check this evening if everything works fine. Thanks.
    – openHBP
    Commented Feb 24, 2022 at 15:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .