Kitloft

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.

Install and run

Runs entirely in your browser. Nothing you type or upload is sent to a server.

Found it useful? Share it:WhatsAppTelegram

How to use systemd service generator

  1. Enter the unit name, the command to run (absolute path) and the user.
  2. Add a working directory and environment variables if your app needs them.
  3. Turn on Run on a schedule to make a timer instead of an always-on service.
  4. Copy the unit file to /etc/systemd/system/ and enable it with the commands shown.

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.

Was this page useful?