~改为使用守护进程启动
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
#!/sbin/openrc-run
|
#!/sbin/openrc-run
|
||||||
|
|
||||||
# 服务名
|
# 服务名
|
||||||
name="ShellCrash"
|
name="shellcrash"
|
||||||
description="Custom proxy service for ShellCrash"
|
description="Custom proxy service for ShellCrash"
|
||||||
#获取目录
|
#获取目录
|
||||||
CRASHDIR=$(cat /etc/profile | grep CRASHDIR | awk -F "\"" '{print $2}')
|
CRASHDIR=$(cat /etc/profile | grep CRASHDIR | awk -F "\"" '{print $2}')
|
||||||
@@ -40,13 +40,13 @@ start() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 启动主程序(后台进程)
|
# 启动主程序(自动守护 + 自动重启)
|
||||||
start-stop-daemon --start \
|
supervise-daemon "${name}" \
|
||||||
--background \
|
|
||||||
--make-pidfile \
|
|
||||||
--pidfile "${pidfile}" \
|
--pidfile "${pidfile}" \
|
||||||
--user "${runuser}" \
|
--user "${runuser}" \
|
||||||
--exec ${COMMAND%% *} -- ${COMMAND#* }
|
--respawn-max 0 \
|
||||||
|
--respawn-delay 3 \
|
||||||
|
--start ${COMMAND%% *} -- ${COMMAND#* }
|
||||||
|
|
||||||
ret=$?
|
ret=$?
|
||||||
eend $ret
|
eend $ret
|
||||||
|
|||||||
Reference in New Issue
Block a user