script systemd auto restart on crash

This commit is contained in:
yusing
2024-03-29 21:43:43 +00:00
parent 662190e09e
commit a0be1f11d3
4 changed files with 22 additions and 7 deletions

View File

@@ -91,11 +91,15 @@ mkdir -p /etc/systemd/system
cat <<EOF > /etc/systemd/system/go-proxy.service
[Unit]
Description=go-proxy reverse proxy
After=network.target
After=network-online.target
Wants=network-online.target systemd-networkd-wait-online.service
[Service]
Type=simple
ExecStart=${APP_ROOT}/bin/go-proxy
WorkingDirectory=${APP_ROOT}
Environment="IS_SYSTEMD=1"
Restart=on-failure
RestartSec=1s
[Install]
WantedBy=multi-user.target
EOF