<分区>
我面临以下问题。我想在 Ubuntu 11.10 系统上运行 python 脚本作为服务(已在以下链接中提到: Python script as linux service/daemon )
我按照上述链接中提到的步骤进行操作,但系统日志中出现以下错误消息:
init: script main process (21826) terminated with status 1
Jun 8 16:59:55 bilbo kernel: [263012.984531] init: script main process ended, respawning
Jun 8 16:59:55 bilbo kernel: [263013.044099] init: script main process (21827) terminated with status 1
上面两行一直在重复。
在说 sudo start script
时,我得到以下信息:
$ sudo start script
script start/running, process 21826
以下是我放在/etc/init
中的script.conf
的内容:
description "Used to start python script as a service"
author "bilbo"
start on runlevel [2]
stop on runlevel [06]
exec python /home/bilbo/scripts/webserver.py
respawn
请告诉我我做错了什么?我是否也必须更改我的 Python 代码?