16ce62a20SAndrew Geissler# This is a system unit for launching Weston with auto-login as the 26ce62a20SAndrew Geissler# user configured here. 36ce62a20SAndrew Geissler# 46ce62a20SAndrew Geissler# Weston must be built with systemd support, and your weston.ini must load 56ce62a20SAndrew Geissler# the plugin systemd-notify.so. 66ce62a20SAndrew Geissler[Unit] 76ce62a20SAndrew GeisslerDescription=Weston, a Wayland compositor, as a system service 86ce62a20SAndrew GeisslerDocumentation=man:weston(1) man:weston.ini(5) 96ce62a20SAndrew GeisslerDocumentation=http://wayland.freedesktop.org/ 106ce62a20SAndrew Geissler 116ce62a20SAndrew Geissler# Make sure we are started after logins are permitted. 126ce62a20SAndrew GeisslerRequires=systemd-user-sessions.service 136ce62a20SAndrew GeisslerAfter=systemd-user-sessions.service 146ce62a20SAndrew Geissler 156ce62a20SAndrew Geissler# If Plymouth is used, we want to start when it is on its way out. 166ce62a20SAndrew GeisslerAfter=plymouth-quit-wait.service 176ce62a20SAndrew Geissler 186ce62a20SAndrew Geissler# D-Bus is necessary for contacting logind. Logind is required. 196ce62a20SAndrew GeisslerWants=dbus.socket 206ce62a20SAndrew GeisslerAfter=dbus.socket 216ce62a20SAndrew Geissler 226ce62a20SAndrew Geissler# Ensure the socket is present 236ce62a20SAndrew GeisslerRequires=weston.socket 246ce62a20SAndrew Geissler 256ce62a20SAndrew Geissler# Since we are part of the graphical session, make sure we are started before 266ce62a20SAndrew Geissler# it is complete. 276ce62a20SAndrew GeisslerBefore=graphical.target 286ce62a20SAndrew Geissler 296ce62a20SAndrew Geissler# Prevent starting on systems without virtual consoles, Weston requires one 306ce62a20SAndrew Geissler# for now. 316ce62a20SAndrew GeisslerConditionPathExists=/dev/tty0 326ce62a20SAndrew Geissler 336ce62a20SAndrew Geissler[Service] 346ce62a20SAndrew Geissler# Requires systemd-notify.so Weston plugin. 356ce62a20SAndrew GeisslerType=notify 366ce62a20SAndrew GeisslerEnvironmentFile=/etc/default/weston 376ce62a20SAndrew GeisslerExecStart=/usr/bin/weston --modules=systemd-notify.so 386ce62a20SAndrew Geissler 396ce62a20SAndrew Geissler# Optional watchdog setup 40*7e0e3c0cSAndrew Geissler#TimeoutStartSec=60 41*7e0e3c0cSAndrew Geissler#WatchdogSec=20 426ce62a20SAndrew Geissler 436ce62a20SAndrew Geissler# The user to run Weston as. 446ce62a20SAndrew GeisslerUser=weston 456ce62a20SAndrew GeisslerGroup=weston 466ce62a20SAndrew Geissler 476ce62a20SAndrew Geissler# Make sure the working directory is the users home directory 486ce62a20SAndrew GeisslerWorkingDirectory=/home/weston 496ce62a20SAndrew Geissler 506ce62a20SAndrew Geissler# Set up a full user session for the user, required by Weston. 516ce62a20SAndrew GeisslerPAMName=weston-autologin 526ce62a20SAndrew Geissler 536ce62a20SAndrew Geissler# A virtual terminal is needed. 546ce62a20SAndrew GeisslerTTYPath=/dev/tty7 556ce62a20SAndrew GeisslerTTYReset=yes 566ce62a20SAndrew GeisslerTTYVHangup=yes 576ce62a20SAndrew GeisslerTTYVTDisallocate=yes 586ce62a20SAndrew Geissler 596ce62a20SAndrew Geissler# Fail to start if not controlling the tty. 606ce62a20SAndrew GeisslerStandardInput=tty-fail 616ce62a20SAndrew GeisslerStandardOutput=journal 626ce62a20SAndrew GeisslerStandardError=journal 636ce62a20SAndrew Geissler 646ce62a20SAndrew Geissler# Log this user with utmp, letting it show up with commands 'w' and 'who'. 656ce62a20SAndrew GeisslerUtmpIdentifier=tty7 666ce62a20SAndrew GeisslerUtmpMode=user 676ce62a20SAndrew Geissler 686ce62a20SAndrew Geissler[Install] 696ce62a20SAndrew Geissler# Note: If you only want weston to start on-demand, remove this line with a 706ce62a20SAndrew Geissler# service drop file 716ce62a20SAndrew GeisslerWantedBy=graphical.target 72