Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 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. |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 6 | [Unit] |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 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 | After=systemd-user-sessions.service |
| 13 | |
| 14 | # If Plymouth is used, we want to start when it is on its way out. |
| 15 | After=plymouth-quit-wait.service |
| 16 | |
| 17 | # D-Bus is necessary for contacting logind. Logind is required. |
| 18 | Wants=dbus.socket |
| 19 | After=dbus.socket |
| 20 | |
| 21 | # Since we are part of the graphical session, make sure we are started before |
| 22 | # it is complete. |
| 23 | Before=graphical.target |
| 24 | |
| 25 | # Prevent starting on systems without virtual consoles, Weston requires one |
| 26 | # for now. |
| 27 | ConditionPathExists=/dev/tty0 |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 28 | |
| 29 | [Service] |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 30 | # Requires systemd-notify.so Weston plugin. |
| 31 | Type=notify |
Andrew Geissler | af5e4ef | 2020-10-16 10:22:50 -0500 | [diff] [blame^] | 32 | EnvironmentFile=/etc/default/weston |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 33 | ExecStart=/usr/bin/weston --modules=systemd-notify.so |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 34 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 35 | # Optional watchdog setup |
| 36 | TimeoutStartSec=60 |
| 37 | WatchdogSec=20 |
| 38 | |
| 39 | # The user to run Weston as. |
| 40 | User=%I |
| 41 | |
| 42 | # Make sure working directory is users home directory |
| 43 | WorkingDirectory=/home/%i |
| 44 | |
| 45 | # Set up a full user session for the user, required by Weston. |
| 46 | PAMName=weston-autologin |
| 47 | |
| 48 | # A virtual terminal is needed. |
| 49 | TTYPath=/dev/tty7 |
| 50 | TTYReset=yes |
| 51 | TTYVHangup=yes |
| 52 | TTYVTDisallocate=yes |
| 53 | |
| 54 | # Fail to start if not controlling the tty. |
| 55 | StandardInput=tty-fail |
| 56 | StandardOutput=journal |
| 57 | StandardError=journal |
| 58 | |
| 59 | # Log this user with utmp, letting it show up with commands 'w' and 'who'. |
| 60 | UtmpIdentifier=tty7 |
| 61 | UtmpMode=user |
| 62 | |
| 63 | [Install] |
| 64 | WantedBy=graphical.target |
| 65 | DefaultInstance=tty7 |