blob: e09625b31c6dbe7121665a554e26e267b809beb1 [file] [log] [blame]
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001# 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 Bishopa34c0302019-09-23 22:34:48 -04006[Unit]
Andrew Geisslerc9f78652020-09-18 14:11:35 -05007Description=Weston, a Wayland compositor, as a system service
8Documentation=man:weston(1) man:weston.ini(5)
9Documentation=http://wayland.freedesktop.org/
10
11# Make sure we are started after logins are permitted.
Andrew Geissler6ce62a22020-11-30 19:58:47 -060012Requires=systemd-user-sessions.service
Andrew Geisslerc9f78652020-09-18 14:11:35 -050013After=systemd-user-sessions.service
14
15# If Plymouth is used, we want to start when it is on its way out.
16After=plymouth-quit-wait.service
17
18# D-Bus is necessary for contacting logind. Logind is required.
19Wants=dbus.socket
20After=dbus.socket
21
Andrew Geissler6ce62a22020-11-30 19:58:47 -060022# Ensure the socket is present
23Requires=weston.socket
24
Andrew Geisslerc9f78652020-09-18 14:11:35 -050025# Since we are part of the graphical session, make sure we are started before
26# it is complete.
27Before=graphical.target
28
29# Prevent starting on systems without virtual consoles, Weston requires one
30# for now.
31ConditionPathExists=/dev/tty0
Brad Bishopa34c0302019-09-23 22:34:48 -040032
33[Service]
Andrew Geisslerc9f78652020-09-18 14:11:35 -050034# Requires systemd-notify.so Weston plugin.
35Type=notify
Andrew Geisslerf0343792020-11-18 10:42:21 -060036EnvironmentFile=/etc/default/weston
Andrew Geisslerc9f78652020-09-18 14:11:35 -050037ExecStart=/usr/bin/weston --modules=systemd-notify.so
Brad Bishopa34c0302019-09-23 22:34:48 -040038
Andrew Geisslerc9f78652020-09-18 14:11:35 -050039# Optional watchdog setup
40TimeoutStartSec=60
41WatchdogSec=20
42
43# The user to run Weston as.
Andrew Geissler6ce62a22020-11-30 19:58:47 -060044User=weston
45Group=weston
Andrew Geisslerc9f78652020-09-18 14:11:35 -050046
Andrew Geissler6ce62a22020-11-30 19:58:47 -060047# Make sure the working directory is the users home directory
48WorkingDirectory=/home/weston
Andrew Geisslerc9f78652020-09-18 14:11:35 -050049
50# Set up a full user session for the user, required by Weston.
51PAMName=weston-autologin
52
53# A virtual terminal is needed.
54TTYPath=/dev/tty7
55TTYReset=yes
56TTYVHangup=yes
57TTYVTDisallocate=yes
58
59# Fail to start if not controlling the tty.
60StandardInput=tty-fail
61StandardOutput=journal
62StandardError=journal
63
64# Log this user with utmp, letting it show up with commands 'w' and 'who'.
65UtmpIdentifier=tty7
66UtmpMode=user
67
68[Install]
Andrew Geissler6ce62a22020-11-30 19:58:47 -060069# Note: If you only want weston to start on-demand, remove this line with a
70# service drop file
Andrew Geisslerc9f78652020-09-18 14:11:35 -050071WantedBy=graphical.target