gkreidl
Posts: 5956
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

xinit problems after latest XORG update & workaround

Tue Dec 20, 2016 4:10 am

If you have been using xinit to start a small X-environment for embedded applications (kiosks, digital signage) or alternate desktops you may have noticed that this doesn't work any more after the latest XORG updates. My kweb and omxplayerGUI manuals describe such scenarios and these descriptions are now obsolete without modifications.

The upstream (testing) XORG seems to have bugs, which they cannot solve at the moment and in order to keep the system secure they have decided to modify some security settings, which in turn keeps xinit from working as it did before and especially for using it from rc.local to boot into such applications.

For the following I assume you have a script named "kiosk" in the root of your home directory (could be anything else), which is executed by xinit; usually it starts a window manager, a task bar, any start-up application etc. From the command line it could be called like this

Code: Select all

xinit ./kiosk
but this doesn't work any more.

A solution for command line use is simple. You just have to add something:

Code: Select all

xinit ./kiosk -- vt$(fgconsole) 
Unfortunately this doesn't work from rc.local (for starting your X application at boot time). The only solution I have found so far is to modify the access rights of all (or some) tty devices, which introduces new security risks.

1) Add user pi to group tty:

Code: Select all

sudo usermod -a -G tty pi
2) Modify Xwrapper (that has always been required on a new Jessie installation):

Code: Select all

sudo nano /etc/X11/Xwrapper.config
and set:

Code: Select all

allowed_users=anybody
3) Add the following to /etc/rc.local (before the "exit 0" line).

Code: Select all

chmod a+rw /dev/tty0
chmod g+rw /dev/tty*
su -l pi -c "xinit ./kiosk" &
This is not a perfect solution, but at least booting into your application is possible again.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

User avatar
owntheweb
Posts: 24
Joined: Tue Jun 16, 2015 1:51 am
Location: Colorado, USA
Contact: Website

Re: xinit problems after latest XORG update & workaround

Tue Feb 14, 2017 9:18 pm

Thanks for posting this! Life is good now thanks to you.
...The only solution I have found so far is to modify the access rights of all (or some) tty devices, which introduces new security risks.
Just checking on this. I'm guessing you have to be logged in as someone first before causing security mayhem of some kind? I'm just trying to keep things somewhat secure as I proceed to make my internet-connected kiosk.

I appreciate the feedback. :)
Worlds to explore. Worlds to create.

gkreidl
Posts: 5956
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: xinit problems after latest XORG update & workaround

Wed Feb 15, 2017 10:34 am

There is one other method I have found:
Set you RPi to boot to the desktop with auto-login,
On the desktop run
lxsession-default-apps
Click on "Autostart" on the left. In the upper right part you will see the applications which are started automatically (pcmanfm --desktop ... for example). Add the programs you need. Disable everything which you don't need (taskbar and desktop, for example).
Close the desktop and start it again.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

User avatar
owntheweb
Posts: 24
Joined: Tue Jun 16, 2015 1:51 am
Location: Colorado, USA
Contact: Website

Re: xinit problems after latest XORG update & workaround

Wed Feb 15, 2017 9:19 pm

Thanks for the feedback! :D
Worlds to explore. Worlds to create.

Return to “Raspbian”