** Description changed:

  [Impact]
  
  Restarting a timer unit that has already executed at least once causes
  the associated service to run immediately, regardless of the configured
  OnCalendar schedule. This results in unintended service executions
  outside the defined schedule.
  
  This issue presents a reliability risk for systems relying on systemd
  timers for precise, predictable scheduling.
  
  [Test Plan]
  
  1. Create a service and a timer.
  
  For the OnCalendar, 46:00 means the service will be triggered on the
  46th minute of every hour, but for testing purposes, you can adjust ti
  to a couple minutes ahead of the current time.
  
  # timer-test.service
  
  [Unit]
  Description="Test service"
-  
+ 
  [Service]
  ExecStart=/bin/echo triggered
  Type=oneshot
-  
  
  # timer-test.timer
  
  [Unit]
  Description="Test timer"
-  
+ 
  [Timer]
  OnCalendar=*-*-* *:46:00
-  
+ 
  [Install]
  WantedBy=timers.target
-  
  
  2. Enable the timer.
  
  # sudo systemctl enable --now timer-test.timer
-  
  
  3. Let the timer trigger once.
  
  This is important because you don't see this behavior if the timer has
  never ran before.
  
-  
  4. Restart the timer:
  
  # systemctl restart timer-test.timer
-  
- 5. View the service status to see the logged echo command and check the time 
when the service was triggered.
+ 
+ 5. View the service status to see the logged echo command and check the
+ time when the service was triggered.
  
  # systemctl status timer-test.service
  
  After restarting the timer, the service will run again even when it is
  not scheduled to run.
  
+ [Where problems could occur]
+ 
+ The potential issue is that this behavior may still occur, meaning
+ services could continue to be triggered immediately after a timer
+ restart, outside their defined OnCalendar schedule.
  
  [Other Info]
  
  The bug has been reported upstream:
  https://github.com/systemd/systemd/issues/31231
  
  It's been fixed in the commit:
  
https://github.com/systemd/systemd/pull/38868/changes/3fc44a0f68412b649e16f12ff2f97a36c615457d
  
  Need to backport this fix to Questing and Noble.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2141296

Title:
  [00427578] Restarting systemd timer triggers service start off-
  schedule

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2141296/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to