systemd Service Generator
Generate a systemd unit for a Laravel queue worker, a Node.js app or a Go binary, with restart policy, environment, a dedicated user and sandboxing.
Free · No sign-up · Your inputs stay in your browser
Input
Generate a systemd service unit
Output
/etc/systemd/system/laravel-worker.service
745 characters
Install with: sudo systemctl daemon-reload && sudo systemctl enable --now laravel-worker. Follow logs with journalctl -u laravel-worker -f. systemd-analyze security laravel-worker scores the sandboxing. A queue worker should be restarted on deploy (php artisan queue:restart) so it loads the new code.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
Why systemd rather than a process manager
systemd is already on the server, restarts crashed processes, starts them at boot, collects their output in the journal and can sandbox them without containers. Restart=always with RestartSec=5 keeps a worker up; the StartLimit settings stop a crash loop from spinning forever.
Sandboxing
ProtectSystem=strict makes the whole file system read-only for the service except the paths in ReadWritePaths, so a compromised process cannot rewrite your code. systemd-analyze security name.service scores the unit. Each directive is explained in systemd.exec(5).