|
| 1 | +# This is a system unit for launching Weston with auto-login as the |
| 2 | +# user configured here. |
| 3 | +# |
| 4 | +# Weston must be built with systemd support, and your weston.ini must load |
| 5 | +# the plugin systemd-notify.so. |
| 6 | +[Unit] |
| 7 | +Description=Weston, a Wayland compositor, as a system service |
| 8 | +Documentation=man:weston(1) man:weston.ini(5) |
| 9 | +Documentation=http://wayland.freedesktop.org/ |
| 10 | + |
| 11 | +# Make sure we are started after logins are permitted. |
| 12 | +Requires=systemd-user-sessions.service |
| 13 | +After=systemd-user-sessions.service |
| 14 | + |
| 15 | +# If Plymouth is used, we want to start when it is on its way out. |
| 16 | +After=plymouth-quit-wait.service |
| 17 | + |
| 18 | +# D-Bus is necessary for contacting logind. Logind is required. |
| 19 | +Wants=dbus.socket |
| 20 | +After=dbus.socket |
| 21 | + |
| 22 | +# Ensure the socket is present |
| 23 | +Requires=weston.socket |
| 24 | + |
| 25 | +# Since we are part of the graphical session, make sure we are started before |
| 26 | +# it is complete. |
| 27 | +Before=graphical.target |
| 28 | + |
| 29 | +# Prevent starting on systems without virtual consoles, Weston requires one |
| 30 | +# for now. |
| 31 | +ConditionPathExists=/dev/tty0 |
| 32 | + |
| 33 | +# Ensure that it doesn't run on 1st boot, since the setup process will kill it |
| 34 | +ConditionPathExists=!/root/.not_logged_in_yet |
| 35 | + |
| 36 | +[Service] |
| 37 | +# Requires systemd-notify.so Weston plugin. |
| 38 | +Type=simple |
| 39 | +EnvironmentFile=/etc/default/weston |
| 40 | +ExecStart=/usr/bin/weston --backend=drm-backend.so --continue-without-input --idle-time=0 |
| 41 | + |
| 42 | +# Optional watchdog setup |
| 43 | +#TimeoutStartSec=60 |
| 44 | +#WatchdogSec=20 |
| 45 | + |
| 46 | +# The user to run Weston as. |
| 47 | +User=root |
| 48 | +Group=root |
| 49 | + |
| 50 | +# Make sure the working directory is the users home directory |
| 51 | +WorkingDirectory=/root/ |
| 52 | + |
| 53 | +# Set up a full user session for the user, required by Weston. |
| 54 | +PAMName=weston-autologin |
| 55 | + |
| 56 | +# A virtual terminal is needed. |
| 57 | +TTYPath=/dev/tty7 |
| 58 | +TTYReset=yes |
| 59 | +TTYVHangup=yes |
| 60 | +TTYVTDisallocate=yes |
| 61 | + |
| 62 | +# Fail to start if not controlling the tty. |
| 63 | +StandardInput=tty-fail |
| 64 | +StandardOutput=journal |
| 65 | +StandardError=journal |
| 66 | + |
| 67 | +# Log this user with utmp, letting it show up with commands 'w' and 'who'. |
| 68 | +UtmpIdentifier=tty7 |
| 69 | +UtmpMode=user |
| 70 | + |
| 71 | +[Install] |
| 72 | +# Note: If you only want weston to start on-demand, remove this line with a |
| 73 | +# service drop file |
| 74 | +WantedBy=graphical.target multi-user.target |
0 commit comments