每次RaspberryPi重新启动时,我需要运行位于/home/pi/Hello_on_startup.py的代码
为此,我在/etc/init/目录中创建了hello.conf文件
description "A script controlled by upstart"
author "Anton"
start on runlevel [2345]
stop on runlevel [016]
respawn
exec /home/pi/Hello_on_startup.py`当我运行命令start hello时,我得到了一个未知任务的答案: hello
发布于 2016-01-15 15:52:17
您需要在您的conf文件中使用一个script...end script块才能识别它,如这里所示。生成的hello.conf文件如下所示:
description "A script controlled by upstart"
author "Anton"
start on runlevel [2345]
stop on runlevel [016]
respawn
script
exec /home/pi/Hello_on_startup.py`
end script在AskUbuntu上也有类似的问题。
https://stackoverflow.com/questions/34814357
复制相似问题