私は Debian ブルスアイを使っています。 systemdサービスのユーザーとしてWestonを実行したいです。デフォルトのdrmバックエンドが必要なので、weston-launchを使用してrootとして実行する必要があるようです。しかし、いくつかの設定を試しましたが、うまくいきません。現在 weston-launch を使用しようとしていますが、次のエラーが発生します。
Date: 2023-02-16 CET
[14:32:56.381] weston 9.0.0
https://wayland.freedesktop.org
Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
Build: 9.0.0
[14:32:56.381] Command line: /usr/bin/weston --log=/tmp/weston.log
[14:32:56.381] OS: Linux, 5.10.52-gba9ade6851ca-dirty, #1 SMP PREEMPT Thu Feb 16 10:37:31 UTC 2023, aarch64
[14:32:56.381] Using config file '/etc/xdg/weston/weston.ini'
[14:32:56.382] Output repaint window is 16 ms maximum.
[14:32:56.382] Loading module '/usr/lib/aarch64-linux-gnu/libweston-9/drm-backend.so'
[14:32:56.388] initializing drm backend
[14:32:56.393] logind: cannot take control over session 8
[14:32:56.394] logind: cannot setup systemd-logind helper (-5), using legacy fallback
[14:32:56.397] using /dev/dri/card1
[14:32:56.397] DRM: supports atomic modesetting
[14:32:56.397] DRM: does not support GBM modifiers
[14:32:56.397] DRM: supports picture aspect ratio
[14:32:56.398] Loading module '/usr/lib/aarch64-linux-gnu/libweston-9/g2d-renderer.so'
/lib/systemd/system/weston.service:
[Unit]
Description=Weston Wayland Compositor (on tty7)
RequiresMountsFor=/run
[email protected] plymouth-quit.service
After=systemd-user-sessions.service [email protected] plymouth-quit-wait.service
[Service]
User=root
PermissionsStartOnly=true
# Log us in via PAM so we get our XDG & co. environment and
# are treated as logged in so we can use the tty:
PAMName=login
# Grab tty7
UtmpIdentifier=tty7
TTYPath=/dev/tty7
TTYReset=yes
TTYVHangup=yes
TTYVTDisallocate=yes
# stderr to journal so our logging doesn't get thrown into /dev/null
StandardOutput=tty
StandardInput=tty
StandardError=journal
EnvironmentFile=-/etc/default/weston
# Weston does not successfully change VT, nor does systemd place us on
# the VT it just activated for us. Switch manually:
ExecStartPre=/bin/chvt 7
ExecStart=/usr/bin/weston-launch --tty /dev/tty7 --user tavla-run -- --log=/var/log/weston.log $OPTARGS
IgnoreSIGPIPE=no
[Install]
WantedBy=multi-user.target
/etc/profile.d/weston.sh:
if test -z "$XDG_RUNTIME_DIR"; then
export XDG_RUNTIME_DIR=/run/user/`id -u`
if ! test -d "${XDG_RUNTIME_DIR}"; then
mkdir --parents "${XDG_RUNTIME_DIR}"
chmod 0700 "${XDG_RUNTIME_DIR}"
fi
fi
/etc/xdg/weston/weston.ini:
[core]
#gbm-format=argb8888
idle-time=0
use-g2d=1
xwayland=true
#drm-device=card0
repaint-window=16
#enable-overlay-view=1
#[shell]
#size=1920x1080
[libinput]
touchscreen_calibrator=true
#[output]
#name=HDMI-A-1
#mode=1920x1080@60
#transform=rotate-90
#[output]
#name=HDMI-A-2
#mode=off
# WIDTHxHEIGHT Resolution size width and height in pixels
# off Disables the output
# preferred Uses the preferred mode
# current Uses the current crt controller mode
#transform=rotate-90
[screen-share]
command=@bindir@/weston --backend=rdp-backend.so --shell=fullscreen-shell.so --no-clients-resize
[shell]
background-image=/usr/share/images/desktop-base/default
background-type=scale-crop
答え1
以下は、あなたが探しているものを正確に説明するいくつかの文書へのクイックリンクです。https://wayland.pages.freedesktop.org/weston/toc/running-weston.html#running-weston-from-a-systemd-service
文書の例
これはキーボードを使用した物理アクセスに依存します。
Debian システムは/etc/systemd/user/
dir を systemd ユーザー単位で使用します。
/etc/systemd/user/weston.socket
[Unit]
Description=Weston, a Wayland compositor
Documentation=man:weston(1) man:weston.ini(5)
Documentation=https://wayland.freedesktop.org/
[Socket]
ListenStream=%t/wayland-0
/etc/systemd/user/weston.service
[Unit]
Description=Weston, a Wayland compositor, as a user service
Documentation=man:weston(1) man:weston.ini(5)
Documentation=https://wayland.freedesktop.org/
# Activate using a systemd socket
Requires=weston.socket
After=weston.socket
# Since we are part of the graphical session, make sure we are started before
Before=graphical-session.target
[Service]
Type=notify
TimeoutStartSec=60
WatchdogSec=20
# Defaults to journal
#StandardOutput=journal
StandardError=journal
# add a ~/.config/weston.ini and weston will pick-it up
ExecStart=/usr/bin/weston
[Install]
WantedBy=graphical-session.target
ファイルを作成したら、systemdに次のコマンドを実行して変更を再ロードするようにします。systemctl --user daemon-reload
マシンにログインセッションが作成されていない場合は、物理的にログインして実行中のウェスタンを起動する必要があります。systemctl --user start weston
VTまたはSSHを介して一般ユーザーとしてログイン可能
この方法を使用するには、サービスを通常のシステムシステム単位で実行する必要があります。
/etc/systemd/system/mysession.service
[Unit]
Description=My graphical session
# Make sure we are started after logins are permitted.
After=systemd-user-sessions.service
# if you want you can make it part of the graphical session
#Before=graphical.target
# not necessary but just in case
#ConditionPathExists=/dev/tty7
[Service]
Type=simple
Environment=XDG_SESSION_TYPE=wayland
ExecStart=/usr/bin/systemctl --wait --user start mysession.target
# The user to run the session as. Pick one!
User=user
Group=user
# Set up a full user session for the user, required by Weston.
PAMName=login
# A virtual terminal is needed.
TTYPath=/dev/tty7
TTYReset=yes
TTYVHangup=yes
TTYVTDisallocate=yes
# Fail to start if not controlling the tty.
StandardInput=tty-fail
# Defaults to journal, in case it doesn't adjust it accordingly
#StandardOutput=journal
StandardError=journal
# Log this user with utmp, letting it show up with commands 'w' and 'who'.
UtmpIdentifier=tty7
UtmpMode=user
[Install]
WantedBy=graphical.target
/etc/systemd/user/mysession.target
[Unit]
Description=My session
BindsTo=mysession.target
Before=mysession.target
いくつかのリロードとloginctl操作の実行
# Reloading the configuration so systemd sees it.
systemctl --user daemon-reload
sudo systemctl daemon-reload
# Starting and testing service.
sudo systemctl start mysession # systemd should ask for a password
loginctl # Verify is mysession was able to do session login
systemctl --user start weston