I want to lanuch weston as a kiosk. It is built in the latest arch package. Since the latest version supports this functionality, I have created a script to launch it and can verify that it does work:
$this->bbcode_second_pass_code('', '# Make sure that $DISPLAY is unset.
unset DISPLAY
# And that $XDG_RUNTIME_DIR has been set and created.
if test -z "${XDG_RUNTIME_DIR}"; then
export XDG_RUNTIME_DIR=/run/weston
if ! test -d "${XDG_RUNTIME_DIR}"; then
mkdir "${XDG_RUNTIME_DIR}"
chmod 0700 "${XDG_RUNTIME_DIR}"1
fi
fi
weston &
sleep 1s # could be less
export WAYLAND_DISPLAY=wayland-0
export DISPLAY=:1
exec /usr/bin/surfer http://localhost')
this works and does exactly what I want. Now I want to launch it as a service file.
I created a service file and am trying to get it to launch but there is a problem with logind and something else, I imagine.
$this->bbcode_second_pass_code('', '[Unit]
Description=Weston Local Browser Kiosk mode
After=network.target
[Service]
Type=simple
User=http
Group=http
RuntimeDirectory=weston
RuntimeDirectoryMode=0700
WorkingDirectory=/srv/http
Environment="HOME=/srv/http"
Environment="XDG_RUNTIME_DIR=/run/weston"
Environment="WAYLAND_DISPLAY=wayland-0"
Environment="DISPLAY=:1"
ExecStart=/usr/bin/weston
ExecStartPost=/usr/bin/sleep 2s ; /usr/bin/surfer http://localhost
ExecStop=/usr/bin/pkill -15 weston
IgnoreSIGPIPE=no
Restart=always
RestartSec=1
[Install]
WantedBy=multi-user.target
')
The journal shows this when it launches:
$this->bbcode_second_pass_code('', 'Mar 07 15:21:17 rune64 weston[2834]: Date: 2021-03-07 CST
Mar 07 15:21:17 rune64 weston[2834]: [15:21:17.601] weston 9.0.0
Mar 07 15:21:17 rune64 weston[2834]: https://wayland.freedesktop.org
Mar 07 15:21:17 rune64 weston[2834]: Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
Mar 07 15:21:17 rune64 weston[2834]: Build: 9.0.0
Mar 07 15:21:17 rune64 weston[2834]: [15:21:17.601] Command line: /usr/bin/weston
Mar 07 15:21:17 rune64 weston[2834]: [15:21:17.601] OS: Linux, 5.10.17-3-ARCH, #1 SMP PREEMPT Wed Mar 3 16:26:04 MST 2021, aarch64
Mar 07 15:21:17 rune64 weston[2834]: [15:21:17.601] Using config file '/srv/http/.config/weston.ini'
Mar 07 15:21:17 rune64 weston[2834]: [15:21:17.602] Output repaint window is 7 ms maximum.
Mar 07 15:21:17 rune64 weston[2834]: [15:21:17.602] Loading module '/usr/lib/libweston-9/fbdev-backend.so'
Mar 07 15:21:17 rune64 weston[2834]: [15:21:17.607] initializing fbdev backend
Mar 07 15:21:17 rune64 weston[2834]: [15:21:17.611] logind: not running in a systemd session
Mar 07 15:21:17 rune64 weston[2834]: [15:21:17.611] logind: cannot setup systemd-logind helper (-61), using legacy fallback
Mar 07 15:21:17 rune64 weston[2834]: [15:21:17.611] fatal: fbdev backend should be run using weston-launch binary, or your system should provide the logind D-Bus API.
Mar 07 15:21:17 rune64 weston[2834]: [15:21:17.611] fatal: failed to create compositor backend
Mar 07 15:21:17 rune64 systemd[1]: local-browser_w.service: Main process exited, code=exited, status=1/FAILURE
Mar 07 15:21:18 rune64 systemd[1]: local-browser_w.service: Control process exited, code=killed, status=15/TERM
Mar 07 15:21:18 rune64 systemd[1]: local-browser_w.service: Failed with result 'exit-code'.
')
I've tried the fbdev and drm backend and get the same error. I do not get the difference between weston-launch and weston. I have a single program I want to run in weston and the script does it, I just need a service file to start and stop it. When I run the script from a vt it works.