TL;DR
Running ubuntu server 20.04 with xserver-xorg x11-xserver-utils xinit openbox
installed. I can place a command within openbox's autorun file and its runs well. Now I wish start openbox, then from a daemon, at some later point start an app to run within the currently open openbox window. How does one get a handle to the current openbox window?
Details
I followed this very helpful tutorial on how to setup a kiosk, its for a raspberry pi, I adapted it to run on ubuntu server.
All runs well; a guest user auto logs in at boot up, then the guest user's .profile file runs startx -- -nocursor
, and inside the openbox autostart file is a command to start chromium. Happy days.
Now I wish to move the command to start chromium out of the openbox autostart file, and place it under the control of supervisor (so if chromium crashes, supervisor will auto restart chromium).
Unfortuantely when supervisor tries to start chromium, running as the guest user, it fails to get the openbox window display. I have verified that in the openbox window, $DISPLAY is set to ":0".
I am guessing there is some other factors at play, that its not just the display I need to set, but maybe the window manager, or gui client, or something like that.
Supervisor config file:
[program:chromium]
environment = DISPLAY=":0"
command = chromium-browser --kiosk
startsecs=6
user=guest
stderr_logfile=/var/log/supervisor/chromium_stderr.log
stdout_logfile=/var/log/supervisor/chromium_stdout.log
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=3
Since it is running as user guest it has virtually no little permissions.
I checked the supervisor error log for the chromium app, and it was failing to open /var/log/Xorg.1.log
, so I chmod 777 it (its stays at 0 bytes as does not grow), now getting:
xauth: timeout in locking authority file /.Xauthority