编辑:显然脚本已运行,但它无法启动我的浏览器。仍然不知道为什么。
我正在尝试使用supervisor来运行命令/脚本,但我似乎无法让它工作。
我理解了Pi_Video_looper,它使用以下脚本执行相同操作:
# Supervisord configuration to run video looper at boot and
# ensure it runs continuously.
[program:video_looper]
command=python -u -m Adafruit_Video_Looper.video_looper
autostart=true
autorestart=unexpected
startsecs=5
所以我根据自己的需要对其进行了修改:
# Supervisord configuration to run video looper at boot and
# ensure it runs continuously.
[program:video_looper]
command=chromium-browser http://google.be --incognito
autostart=true
autorestart=unexpected
startsecs=5
我还将它与命令一起使用:
python /home/pi/Startup/Script.py
哪些测试然后调用浏览器,但也没有做任何事情,尽管它从命令行运行完美。我错过了什么吗?
编辑:重启后不起作用,sudo service supervisor restart
编辑2: 日志文件显示它应该正在运行,所以显然它只是不在我的GUI中打开它?:
2016-01-27 16:40:43,569 INFO daemonizing the supervisord process
2016-01-27 16:40:43,573 INFO supervisord started with pid 4767
2016-01-27 16:40:44,583 INFO spawned: 'video_looper' with pid 4773
2016-01-27 16:40:49,593 INFO success: video_looper entered RUNNING state, process has stayed up for > than 5 seconds (startsecs)
答案 0 :(得分:4)
下面的工作版本: 这里的主要问题是,由于某些不明原因,铬不能以root身份运行
# Supervisord configuration to run chromium at boot and
# ensure it runs continuously.
[program:chromiumbrowser]
command=chromium-browser http://google.be --incognito
user=pi
autostart=true
autorestart=unexpected
startsecs=5