How to start weston with non root user?

Vikas Patil vikasmpatil at gmail.com
Wed Apr 27 13:53:47 UTC 2016


Dear All,

I have a requirement to start the weston 1.8.0 with non-root user. I
tried it starting weston using following commands in systemd unit file
with "root" user (first to verify if all commands works) .
However with this it shows service status as "dead". Later intension
is to start with some user. e.g User=display

Could you please give some pointer what might be going wrong here? How
to start weston correctly without root user? My target is based on
systemd but it is not running "systemd-logind"

ExecStartPre=/bin/mkdir -p /var/run/root/1000
ExecStartPre=/bin/chmod 0700 /var/run/root/1000
ExecStart=/usr/bin/openvt -c 1 /usr/bin/weston-launch -- --idle-time=0
--device=/dev/fb1 --backend=fbdev-backend.so --use-gal2d=0 --use-gl=1
--log=/tmp/weston.log


root at a1linux:~# systemctl status weston -l
weston.service - weston (wayland compositor)
   Loaded: loaded (/lib/systemd/system/weston.service; static)
   Active: inactive (dead) since Thu 1970-01-01 00:00:02 UTC; 45 years
9 months ago
  Process: 242 ExecStart=/usr/bin/openvt -c 1 /usr/bin/weston-launch
-u root -- --device=/dev/fb1 --backend=fbdev-backend.so --use-gal2d=0
--use-gl=1 --log=/tmp/weston.log (code=exited, status=0/SUCCESS)
  Process: 224 ExecStartPre=/bin/chmod 0700 /var/run/root/1000
(code=exited, status=0/SUCCESS)
  Process: 160 ExecStartPre=/bin/mkdir -p /var/run/root/1000
(code=exited, status=0/SUCCESS)
 Main PID: 242 (code=exited, status=0/SUCCESS)
root at a1linux:~#


However when I start weston using one of following command it works fine.

1. Inside weston.service
ExecStart=/usr/bin/weston --tty=1 --device=/dev/fb1
--backend=fbdev-backend.so --use-gal2d=0 --use-gl=1
--log=/tmp/weston.log

or

2. Manually running commands on terminal (teraterm)
#export XDG_RUNTIME_DIR=/var/run/root/1000
#openvt -c 1 /usr/bin/weston-launch -- --device=/dev/fb1
--backend=fbdev-backend.so --use-gal2d=0 --use-gl=1
--log=/tmp/weston.log
- However in this case I can see weston is running but no GUI on
display also could not locate any error in weston.log. What might be
going wrong here?

Thanks & regards,
Vikash


More information about the wayland-devel mailing list