mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-05-13 13:58:22 +00:00
fix(alpine): restart_xray uses rc-service; OpenRC reload reads pidfile contents
`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.
This commit is contained in:
parent
9f06bffbea
commit
4c2915586c
2 changed files with 6 additions and 2 deletions
2
x-ui.rc
2
x-ui.rc
|
|
@ -13,6 +13,6 @@ start_pre(){
|
||||||
}
|
}
|
||||||
reload() {
|
reload() {
|
||||||
ebegin "Reloading ${RC_SVCNAME}"
|
ebegin "Reloading ${RC_SVCNAME}"
|
||||||
kill -USR1 $pidfile
|
kill -USR1 $(cat $pidfile)
|
||||||
eend $?
|
eend $?
|
||||||
}
|
}
|
||||||
6
x-ui.sh
6
x-ui.sh
|
|
@ -436,7 +436,11 @@ restart() {
|
||||||
}
|
}
|
||||||
|
|
||||||
restart_xray() {
|
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"
|
LOGI "xray-core Restart signal sent successfully, Please check the log information to confirm whether xray restarted successfully"
|
||||||
sleep 2
|
sleep 2
|
||||||
show_xray_status
|
show_xray_status
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue