- readlink /proc/$$/fd/255
<span style="font-size:12px;">if [ x"$(ps -ef | grep incoming.py | grep -v grep)" = x"" ] ; then
dir=`dirname $(readlink /proc/$$/fd/255)`
start=${dir}/incoming.py
nohup python ${start} >/dev/null 2>&1 &
echo 'incoming startup:'
fi</span>
- 除了kill -9外的其他进程参数,kill -2也能结束while true死循环,但是kill -18不可以
HUP 1 终端断线
INT 2 中断(同 Ctrl + C)
QUIT 3 退出(同 Ctrl + \)
TERM 15 终止
KILL 9 强制终止
CONT 18 继续(与STOP相反, fg/bg命令)
STOP 19 暂停(同 Ctrl + Z)