Systemd timers

sanjikick10

New Member
Joined
Sep 16, 2025
Messages
3
Reaction score
0
Credits
35
Hello,

I am using an Ubuntu 24.04 system and am working with Systemd timers. The Timer I currently have is supposed to execute both on boot as well as every hour of it being active. I see the service when I run ‘systemctl list-timers’ but both on boot when it’s time to run it does successfully execute the service even though it says the time that it was last ran. When I execute the command that it’s supposed to run on the command line, it works perfectly.

Specifically, I’m running an ADSys service, which applies Windows GPOs after the Linux machine is joined to the domain using SSSD.

Wanted to know If anyone has had a problem with Systemd timers like this and what was your solution. Thank you in advance!
 


I have had many issues with systemd timers. in that it never seems to work. My solution was to install cron which did work and that was the solution.
If anybody has solution for the systemd timers I also would like to hear it.
below is my notes for cron if you decide to go that way.... it is for fedora but ubuntu just replace dnf with apt-get

=========================== chron ===============================

chron services are not installed or disabled or masked

dnf install cronie
dnf install crond
dnf install chrony

systemctl enable crond
enable and start them.

===========================================================
a simple way to manage the cron jobs is to use webmin
 
Thank you for your reply! I’ll use cronjobs. Just was curious in getting Systemd timers to work since in the process of joining a Linux machine to a Microsoft Active Directory domain, using sssd & ADSys, the refresh service and timer is automatically created. Didn’t have to create it from scratch.
 
I see the service when I run ‘systemctl list-timers’ but both on boot when it’s time to run it does successfully execute the service even though it says the time that it was last ran. When I execute the command that it’s supposed to run on the command line, it works perfectly.
If timer works and service is executed then what's the problem?

When dealing with system units your best friend is journalctl to investigate what's happening.
 
I see the service when I run ‘systemctl list-timers’ but both on boot when it’s time to run it does successfully execute the service even though it says the time that it was last ran.

Code:
man systemd.timer:
Note that in case the unit to activate is already active at the time the
       timer elapses it is not restarted, but simply left running. There is no
       concept of spawning new service instances in this case. Due to this,
       services with RemainAfterExit=yes set (which stay around continuously
       even after the service's main process exited) are usually not suitable
       for activation via repetitive timers

Simply use a second timer and make sure with a dependency it does not start while the first one (at boot) is still active.
 


Follow Linux.org

Members online


Top