kiosk-shell systemd start script, touchscreen calibration
I am trying to figure out wayland/weston and trying to migrate from xorg. This is on a RaspberryPi running Arch Linux. I have googled around and figured out how to launch kiosk with a full screen browser from a vt, but need to be able to launch it as a systemd service and cannot figure out how to do it. I googled around and was able to make a script that launches what I want
# 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
# Run weston:
weston &
sleep 1s # could be less
export WAYLAND_DISPLAY=wayland-0
export DISPLAY=:1
exec /usr/bin/luakit http://localhost
so then I tried to make a service file to do the same
[Unit]
Description=Weston Local Browser Kiosk mode
After=network.target
[Service]
Type=notify
PAMName=login
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/luakit http://localhost
ExecStop=/usr/bin/pkill -15 weston
IgnoreSIGPIPE=no
Restart=always
RestartSec=1
[Install]
WantedBy=multi-user.target
but every time I get this and no display:
Mar 08 08:46:45 rune64 systemd[1]: Starting Weston Local Browser Kiosk mode...
Mar 08 08:46:45 rune64 weston[4330]: Date: 2021-03-08 CST
Mar 08 08:46:45 rune64 weston[4330]: [08:46:45.879] weston 9.0.0
Mar 08 08:46:45 rune64 weston[4330]: https://wayland.freedesktop.org
Mar 08 08:46:45 rune64 weston[4330]: Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
Mar 08 08:46:45 rune64 weston[4330]: Build: 9.0.0
Mar 08 08:46:45 rune64 weston[4330]: [08:46:45.879] Command line: /usr/bin/weston
Mar 08 08:46:45 rune64 weston[4330]: [08:46:45.879] OS: Linux, 5.10.20-1-ARCH, #1 SMP PREEMPT Fri Mar 5 05:40:43 MST 2021, aarch64
Mar 08 08:46:45 rune64 weston[4330]: [08:46:45.879] Using config file '/srv/http/.config/weston.ini'
Mar 08 08:46:45 rune64 weston[4330]: [08:46:45.879] Output repaint window is 7 ms maximum.
Mar 08 08:46:45 rune64 weston[4330]: [08:46:45.880] Loading module '/usr/lib/libweston-9/fbdev-backend.so'
Mar 08 08:46:45 rune64 weston[4330]: [08:46:45.885] initializing fbdev backend
Mar 08 08:46:45 rune64 weston[4330]: [08:46:45.888] logind: not running in a systemd session
Mar 08 08:46:45 rune64 weston[4330]: [08:46:45.889] logind: cannot setup systemd-logind helper (-61), using legacy fallback
Mar 08 08:46:45 rune64 weston[4330]: [08:46:45.889] <stdin> not a vt
Mar 08 08:46:45 rune64 weston[4330]: [08:46:45.889] if running weston from ssh, use --tty to specify a tty
Mar 08 08:46:45 rune64 weston[4330]: [08:46:45.889] fatal: fbdev backend should be run using weston-launch binary, or your system should provide the logind D-Bus API.
Mar 08 08:46:45 rune64 weston[4330]: [08:46:45.889] fatal: failed to create compositor backend
Mar 08 08:46:45 rune64 systemd[1]: local-browser_w.service: Main process exited, code=exited, status=1/FAILURE
Mar 08 08:46:45 rune64 systemd[1]: local-browser_w.service: Failed with result 'exit-code'.
Mar 08 08:46:45 rune64 systemd[1]: Failed to start Weston Local Browser Kiosk mode.
I get similar response if I use the drm-backend. What is the appropriate way to do this? I think the answer to this will be useful to others trying to move from a xorg kiost install to a wayland/weston kiosk...