All tools / DevOps & infrastructure
systemd service generator
Turn any command into a supervised Linux service that restarts on failure, or a scheduled job with a timer.
Common questions
Should I use Restart=always or on-failure?
on-failure restarts the service when it crashes or exits with an error, but not when it stops cleanly. always also restarts after a clean exit, which suits services that should never stop. StartLimitBurst stops endless restart loops.
Why does the sandbox break my app?
ProtectSystem=strict makes the whole file system read-only except the paths in ReadWritePaths, StateDirectory (/var/lib/name) and LogsDirectory (/var/log/name). ProtectHome hides /home. Add any folder your app writes to, or turn sandboxing off.
Why use a systemd timer instead of cron?
Timers log to the journal, can catch up on missed runs with Persistent=true, spread load with a random delay, and never run two copies at once. Check the schedule with systemd-analyze calendar "Mon..Fri 09:00".
Where do the files go?
System services go in /etc/systemd/system/. Run systemctl daemon-reload after every change.
Is my input sent anywhere?
No. The unit files are generated in your browser.