From 4c2915586c3a376beb39ceb2e0024d5ada7af2db Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Mon, 11 May 2026 09:05:36 +0200 Subject: [PATCH] fix(alpine): restart_xray uses rc-service; OpenRC reload reads pidfile contents MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `14. Restart Xray` failed on Alpine with `systemctl: command not found` — restart_xray was the only service action missing an Alpine branch. While fixing it, the OpenRC reload action was passing the pidfile path to `kill` instead of the PID inside it, so `rc-service x-ui reload` would have failed too. --- x-ui.rc | 2 +- x-ui.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/x-ui.rc b/x-ui.rc index cfb54211..55f6246b 100644 --- a/x-ui.rc +++ b/x-ui.rc @@ -13,6 +13,6 @@ start_pre(){ } reload() { ebegin "Reloading ${RC_SVCNAME}" - kill -USR1 $pidfile + kill -USR1 $(cat $pidfile) eend $? } \ No newline at end of file diff --git a/x-ui.sh b/x-ui.sh index abba9226..020c686f 100644 --- a/x-ui.sh +++ b/x-ui.sh @@ -436,7 +436,11 @@ restart() { } restart_xray() { - systemctl reload x-ui + if [[ $release == "alpine" ]]; then + rc-service x-ui reload + else + systemctl reload x-ui + fi LOGI "xray-core Restart signal sent successfully, Please check the log information to confirm whether xray restarted successfully" sleep 2 show_xray_status