From 5d3ac8d01b52813e9a3aa024386b1c6f9fbfc1a3 Mon Sep 17 00:00:00 2001 From: greekstreet Date: Sat, 1 May 2021 16:46:46 +0800 Subject: [PATCH] make it compatible with other ps program After installing procps-ng-ps, the ps command is not killing process when restarting. The consquence is there will be too many xray or v2ray process started which leads to a broken proxied network. To avoid this, we make ssr-plus to explicitly use busybox ps program. --- luci-app-ssr-plus/root/etc/init.d/shadowsocksr | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/luci-app-ssr-plus/root/etc/init.d/shadowsocksr b/luci-app-ssr-plus/root/etc/init.d/shadowsocksr index b0014550..085296ef 100755 --- a/luci-app-ssr-plus/root/etc/init.d/shadowsocksr +++ b/luci-app-ssr-plus/root/etc/init.d/shadowsocksr @@ -44,6 +44,7 @@ CRON_FILE=/etc/crontabs/root EXTRA_COMMANDS='reset' EXTRA_HELP=" reset Reset to default settings" #extra_command "reset" "Reset to default settings" +PS="/bin/busybox ps" uci_get_by_name() { local ret=$(uci get $NAME.$1.$2 2>/dev/null) @@ -840,13 +841,13 @@ stop() { iptables -X SSR-SERVER-RULE 2>/dev/null fi if [ -z "$switch_server" ]; then - ps -w | grep -v "grep" | grep ssr-switch | awk '{print $1}' | xargs kill -9 >/dev/null 2>&1 & + $PS -w | grep -v "grep" | grep ssr-switch | awk '{print $1}' | xargs kill -9 >/dev/null 2>&1 & rm -f /var/lock/ssr-switch.lock killall -q -9 kcptun-client fi - ps -w | grep -v "grep" | grep ssr-monitor | awk '{print $1}' | xargs kill -9 >/dev/null 2>&1 & - ps -w | grep -v "grep" | grep "sleep 0000" | awk '{print $1}' | xargs kill -9 >/dev/null 2>&1 & - ps -w | grep -v "grep" | grep "$TMP_PATH" | awk '{print $1}' | xargs kill -9 >/dev/null 2>&1 & + $PS -w | grep -v "grep" | grep ssr-monitor | awk '{print $1}' | xargs kill -9 >/dev/null 2>&1 & + $PS -w | grep -v "grep" | grep "sleep 0000" | awk '{print $1}' | xargs kill -9 >/dev/null 2>&1 & + $PS -w | grep -v "grep" | grep "$TMP_PATH" | awk '{print $1}' | xargs kill -9 >/dev/null 2>&1 & killall -q -9 v2ray-plugin obfs-local xray-plugin rm -f /var/lock/ssr-monitor.lock if [ -f "/var/dnsmasq.d/dnsmasq-ssrplus.conf" ]; then