Why is my systemd timer inactive after reboot or resume although it is enabled

Abstract: Fix systemd timers that fail to trigger after reboot or resume by replacing OnBootSec with OnCalendar for persistent scheduling.

Created: 2026-08-30 by
Systemd timers can appear inactive after a reboot or resume because the timer unit itself is not persistent across power cycles unless specifically configured. While enabling a timer ensures it starts on boot, relying solely on OnBootSec means the trigger resets every time the system powers up. To ensure reliable execution regardless of uptime, you must use monotonic or calendar-based triggers that account for system state changes and sleep cycles properly.

Understanding Timer Persistence and State

When you enable a systemd timer with systemctl enable mytimer.timer, you are creating a symlink that tells systemd to start that specific timer unit during the boot process. This action does not guarantee that the timer will fire immediately upon login or after waking from suspend; it only guarantees that the timer daemon will be active and listening for events once the system is fully booted. If your timer configuration relies exclusively on OnBootSec=5min, the countdown begins at the moment the service starts during boot. Consequently, if you wait five minutes after logging in, the event fires. However, if the system reboots or suspends, that specific monotonic counter is lost because it is tied to the current kernel uptime, not wall-clock time. This behavior often leads users to believe the timer is "inactive" or broken. In reality, the timer is functioning exactly as designed by resetting its internal clock whenever the systemd manager restarts. The confusion arises when users expect a one-time delay that persists across reboots, which is not how standard monotonic timers work. For tasks that need to run relative to the last boot, this is fine. But for scheduled maintenance or recurring jobs, monotonic timers are insufficient because they do not survive suspension or unexpected shutdowns gracefully without manual intervention.

Using Calendar-Based Timers for Reliability

The most robust solution for ensuring a timer runs predictably after any reboot or resume is to switch from monotonic triggers to calendar-based specifications. Calendar timers use real-world time formats defined in the OnCalendar= directive within the .timer file. Because these timers rely on the system clock rather than kernel uptime, they are immune to the reset problem associated with OnBootSec. When the system boots, systemd checks the current time against the calendar specification. If the specified time has passed since the last activation, the corresponding service is triggered immediately. To implement this, edit your timer unit file, typically located in /etc/systemd/system/ or /usr/lib/systemd/system/. Replace any existing OnBootSec= or OnUnitActiveSec= lines with an OnCalendar= entry. For example, to run a job daily at 2:00 AM, you would use OnCalendar=*-*-* 02:00:00. After making changes, reload the daemon with systemctl daemon-reload and restart the timer using systemctl restart mytimer.timer. You can verify the next activation time by running systemctl status mytimer.timer, which will display the precise date and time the service is scheduled to execute next. This method ensures that even if the system was off during the scheduled time, it will trigger as soon as possible after booting, depending on your specific configuration.

Handling Sleep and Resume Scenarios

While calendar timers solve the reboot issue, they can also behave unexpectedly during suspend if not configured correctly. By default, systemd timers are paused during system sleep states like suspend or hibernate. When the system wakes up, the timer resumes counting down from where it left off. For monotonic timers, this pause effectively extends the delay, which might be desirable. However, for calendar timers, if the wake-up time misses the exact second of the scheduled event, the timer might skip that occurrence entirely until the next cycle. To address this, you can configure the timer to activate immediately upon resume if the scheduled time has been missed. Add Persistent=true to the [Timer] section of your timer unit file. This setting tells systemd to check if the timer was supposed to have fired while the system was asleep. If it did, the service is triggered immediately upon resume. This is crucial for backup scripts or cleanup jobs that must happen at specific intervals regardless of whether the machine was sleeping. Without Persistent=true, a calendar timer might silently skip a day's worth of tasks if the computer was powered off during the execution window. Always test this behavior in a non-production environment to ensure it aligns with your operational requirements.

Debugging Common Issues

If your timer still appears inactive after applying these fixes, check the journal logs for errors. Use journalctl -u mytimer.timer --since "1 hour ago" to see if systemd attempted to start the service but failed due to permission issues or missing dependencies. Another common pitfall is incorrect syntax in the OnCalendar directive. Systemd uses a strict format for calendar specs; a single typo can cause the timer to never match. You can validate your calendar spec using systemd-analyze calendar "your-spec-here", which will output the next few occurrences or return an error if the format is invalid. Additionally, ensure that the underlying service file is valid and executable. A malformed service file can prevent the timer from triggering successfully, even if the timer unit itself is active. Check the permissions of the script or binary called by the service. It should be executable by the user or root context defined in the service file. If the service fails to start, the timer may remain in an "active (waiting)" state without producing visible results, leading to the assumption that it is inactive. Reviewing the exit codes and standard output of the service via journalctl is the most effective way to diagnose these silent failures. For more information on managing service execution timing, see Controlling Timing of Execution in *.service File with systemd.

Frequently Asked Questions

Why does my timer fire immediately after reboot?

This usually happens when using a calendar timer with Persistent=true and the system was suspended past the scheduled time. Upon resume, systemd detects the missed window and triggers the service immediately to catch up. Disable persistence if you want to strictly adhere to the original schedule.

Can I use OnBootSec for recurring tasks?

No, OnBootSec is monotonic and resets every time the system boots. It is suitable for one-time delays after startup but cannot guarantee recurring execution over days or weeks because the counter is lost during reboots and sleeps.

How do I check when a timer will next fire?

Run systemctl status yourtimer.timer to see the "Active" state and the "Next Elapsed" or "Next Trigger" timestamp. This output provides the exact date and time systemd plans to activate the associated service.

What causes a systemd timer to show as failed?

A timer shows as failed if the underlying service it triggers exits with a non-zero status code or encounters an error during execution. Check journalctl -u yourservicename.service for detailed error messages regarding permissions, missing files, or runtime exceptions.

Do timers persist across kernel updates?

Yes, systemd timer configurations are stored in unit files on disk and are independent of the kernel version. They will continue to function normally after a kernel update, provided the systemd package itself is updated correctly.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More