fix(web): stop clean shutdowns logging false errors, and let the panel stop its children (#6884)

A systemd stop or restart logged "Server shutdown failed: use of closed
network connection | xray is not running" on every clean exit. httpServer.Shutdown
already closes the listener, so the second Close's net.ErrClosed is now ignored,
and StopXray's not-running case is a sentinel (ErrXrayNotRunning) that Stop
treats as done.

The shipped units now use KillMode=mixed, so SIGTERM reaches only the panel,
which stops Xray and the sidecars itself; systemd still SIGKILLs whatever is left
after the stop timeout.
This commit is contained in:
Rouzbeh†
2026-10-24 06:45:34 +03:30
committed by GitHub
parent 40cea0c2fe
commit ad470681ef
9 changed files with 67 additions and 11 deletions
+1
View File
@@ -14,6 +14,7 @@ ExecStart=/usr/local/x-ui/x-ui
ExecReload=/bin/kill -USR1 $MAINPID
Restart=on-failure
RestartSec=5s
KillMode=mixed
# The panel intentionally stays root: it supervises the Xray child processes,
# edits netfilter state and reads TLS private keys. These settings only bound