Kcptun: 是否考虑增加一个命令行选项 "--pid filename" ?

Created on 29 Sep 2016  ·  4Comments  ·  Source: xtaci/kcptun

作者您好,我建议增加一个命令行选项:"--pid filename" 。把进程ID记录到指定文件中。

有这个选项后,停止脚本就能很方便的找到PID。

谢谢!

Most helpful comment

用 start-stop-daemon 解决问题了。
kill的方法一个实例能用,但如果启动了多个实例,不记录pid无法只停止其中的一个。

All 4 comments

自己写个停止脚本就是了,以server_linux_amd64为例
PID=ps -ef | grep server_linux_amd64 | grep -v grep | awk '{print $2}'
if [[ "" != "$PID" ]]; then
echo "killing $PID"
kill -9 $PID
fi

start-stop-daemon 可获得pid,应该是标准方式产生 /var/run/xxxx.pid

我喜欢用killall

xtaci [email protected]于2016年9月29日周四 22:21写道:

start-stop-daemon 可能获得pid,应该是标准方式产生 /var/run/xxxx.pid


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/xtaci/kcptun/issues/208#issuecomment-250480274, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ASpHqSkoE2iXZATuvD61ZBHx3NUZhjYXks5qu8lcgaJpZM4KKBXG
.

用 start-stop-daemon 解决问题了。
kill的方法一个实例能用,但如果启动了多个实例,不记录pid无法只停止其中的一个。

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cxjava picture cxjava  ·  8Comments

channingbox picture channingbox  ·  8Comments

sosmygirl picture sosmygirl  ·  6Comments

weiyu99 picture weiyu99  ·  9Comments

trivita picture trivita  ·  3Comments