OpenWRT - graceful service stop, restart and respawn if crashes (#1245)

This commit is contained in:
evrial
2025-10-06 15:35:44 +00:00
committed by GitHub
parent 75b372437c
commit 2a94e1d1ec

View File

@@ -757,20 +757,12 @@ start_service() {
procd_set_param user beszel
procd_set_param pidfile /var/run/beszel-agent.pid
procd_set_param env PORT="$PORT" KEY="$KEY" TOKEN="$TOKEN" HUB_URL="$HUB_URL"
procd_set_param respawn
procd_set_param stdout 1
procd_set_param stderr 1
procd_close_instance
}
stop_service() {
killall beszel-agent
}
restart_service() {
stop
start
}
# Extra command to trigger agent update
EXTRA_COMMANDS="update restart"
EXTRA_HELP=" update Update the Beszel agent