이는 키보드를 사용한 물리적 액세스에 의존합니다.

이는 키보드를 사용한 물리적 액세스에 의존합니다.

저는 데비안 불스아이를 사용하고 있습니다. systemd 서비스의 사용자로 Weston을 실행하고 싶습니다. 기본 drm 백엔드가 필요해서 weston-launch를 사용하여 루트로 실행해야 할 것 같습니다. 그러나 여러 구성을 시도했지만 작동하지 않습니다. 현재 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

문서의 예

이는 키보드를 사용한 물리적 액세스에 의존합니다.

데비안 시스템은 /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 

관련 정보