该方法未经本人实践!


http://www.yihaomen.com/article/python/190.htm

写了一个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



然后重新启动就可以了。
posted on 2022-07-05 18:13  我在全球村  阅读(57)  评论(0编辑  收藏  举报