Search code examples
pythonsupervisordstartupscript

Supervisor command won't start Chromium


EDIT: Apparently the script DOES run, but it just doesn't start my browser. Still don't know why tho.

I'm trying to use supervisor to run commands/scripts, but I don't seem to be able to get it to work.

I got the idea of the Pi_Video_looper that does the same with the following script :

# 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

So I modified it to my needs to this:

# 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

I also used it with the command :

python /home/pi/Startup/Script.py

Which does some testing and then calls the browser, but doesn't do anything either, allthough it runs perfectly from commandline. Am I missing something?

EDIT: Doesn't work after reboot, doesn't work after a sudo service supervisor restart

EDIT 2 : Logfile shows that it should be running, so apparently it just doesn't open it in my 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)

Solution

  • The working version below: The main issue here was that chromium can't be ran as root for some obscure reason

    # 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