后台运行python服务 起停脚本
启动脚本
start.sh
#!/bin/bash nohup <command> > /dev/null 2>&1 & echo $! > command.ppid
停止脚本
#!/bin/bash ppid=`cat command.ppid` ps -o pid --ppid $ppid --no-heading | awk '{print$1}' | xargs -I {} kill {}
启动脚本
start.sh
#!/bin/bash nohup <command> > /dev/null 2>&1 & echo $! > command.ppid
停止脚本
#!/bin/bash ppid=`cat command.ppid` ps -o pid --ppid $ppid --no-heading | awk '{print$1}' | xargs -I {} kill {}