Stop systemd timers from clobbering your system boot

Cron & Task Scheduling (Cron/Systemd Timers/At)

Stop systemd timers from clobbering your system boot

🧩 The Challenge

Every time I deploy a bunch of startup services, the disk IO spikes through the roof during boot because everything is fighting for resources. It’s like watching a herd of cats try to run through a screen door.

💡 The Fix

Just use the OnBootSec and OnUnitActiveSec directives to stagger your services. You can tell your maintenance tasks to chill out for a few minutes after the system is actually up and running.

[Timer]
OnBootSec=5min
OnUnitActiveSec=1h
[Unit]
Description=Run my cleanup script after boot delay

⚙️ Why It Works

Setting a delay ensures your core system services finish their handshake before your maintenance tasks start hammering the CPU. Most people forget systemd timers are way more granular than the old crontab “sleep” hacks.

🚀 Pro-Tip: Use systemd-analyze blame to see exactly which timer is delaying your login prompt.

Linux Tips & Tricks | © ngelinux.com | 7/21/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted