linux chkconfig配置自启动shell
$vim /etc/init.d/temp2file_luncher.sh#!/bin/bash# chkconfig: 2345 66 36# /usr/bin/python#case "$1" instart)echo -n "Start: "su root -c "nohup python /home/pi/Running/temp2fi
·
$vim /etc/init.d/temp2file_luncher.sh
#!/bin/bash
# chkconfig: 2345 66 36
# /usr/bin/python
#
case "$1" in
start)
echo -n "Start: "
su root -c "nohup python /home/pi/Running/temp2file.py &"
echo "Done."
;;
stop)
echo -n "Stop: "
killall -9 temp2file.py
echo "Done."
;;
*)
echo "Usage: python { start | stop }"
exit 1
esac
exit 0
$chkconfig --add temp2file_luncher.sh
更多推荐
已为社区贡献1条内容
所有评论(0)