将python 脚本作为服务在ubuntu 11.10 中启动。
摘要: 写了一个python 服务程序,但每次都在控制台下启动,感觉很不好,始终有个console界面,所以就想把他加入到系统自动启动中。在ubuntu 11.10 中,进入 /etc 目录代码片段, 请查看文章详情 ...
写了一个python 服务程序,但每次都在控制台下启动,感觉很不好,始终有个console界面,所以就想把他加入到系统自动启动中。
在ubuntu 11.10 中,进入 /etc 目录
cd /etc sudo gedit rc.local
增加内容:
#!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. cd /home/summer/MyService/iNet/inetgarment python serversocket.py exit 0
然后重新启动就可以了。
www.biaoyu.org 评论于: 2012-03-29
leptins 评论于: 2012-03-29
www.linuxyan.com 评论于: 2012-03-29
www.naermei.com 评论于: 2012-03-28
www.happyold360.o 评论于: 2012-03-28
www.hanyue-sh.com 评论于: 2012-03-28