Weston on RPi: running as non-root

Mika Boström mika.bostrom at nomovok.com
Thu Jan 3 02:31:50 PST 2013


I had a strange problem: after weston had started on RPi, I couldn't get
any of the clients to run. I'm posting this in the hope that it will
help someone else solve similar problems.

Steps taken:
1. went with raspbian (from official image)
2. rebuilt cairo packages to enable cairo-glesv2
3. followed http://wayland.freedesktop.org/raspberrypi.html with slight
modifications:
A) --disable-configuration for wayland build
B) made sure weston was built without cairo-egl
C) -rwsr-xr-x 1 root pi 382624 Jan  3 10:55 local/bin/weston

Last change was needed to get weston running at all. It starts, and
seems to work, but trying to launch any of the applications simply
results in an error. Weston-terminal, smoke and flower all result in
identical error message:

"""
failed to create display: Permission denied
failed to create display: Permission denied
"""

... which was kind of strange. Looking through the client code, this
comes from display_create() error handling, and the code itself
eventually expands to wl_display_connect(). The reason seems to be this:

srwxr-xr-x 1 root pi    0 Jan  3 11:52 wayland-0

Yep. Non-root user doesn't have permission to connect to Wayland socket.

** ONE-TIME SOLUTION **

After weston has launched:

% sudo chmod g+w /run/shm/wayland/wayland-0


** "More permanent" solution **

Launch weston via a wrapper which first sets umask to 0002, so the
socket is created with group rw bits set.


That's it. Have fun, and keep on hacking.

-- 
 Mika Boström / mika.bostrom at nomovok.com
 Software Architect



More information about the wayland-devel mailing list