Skip to content

Instantly share code, notes, and snippets.

@gilangvperdana
Last active July 4, 2022 04:20
Show Gist options
  • Save gilangvperdana/1748fecdcf1b15b7280e086d7d656be0 to your computer and use it in GitHub Desktop.
Save gilangvperdana/1748fecdcf1b15b7280e086d7d656be0 to your computer and use it in GitHub Desktop.
Auto Restart Linux Systemd Service

Auto Restart Linux Systemd Service

If you have an important service, than you not want to monitor & operate those service 24/7 you can guard against catastrophic crashes by doing auto-restart.

Execution

nano /lib/systemd/system/nginx.service
[Service]
Restart=on-failure
RestartSec=5s
systemctl daemon-reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment