[Unit] Description=X Windows display server After=systemd-user-sessions.service # D-Bus is necessary for contacting logind. Logind is required. Wants=dbus.socket After=dbus.socket Conflicts=getty@tty7.service Before=graphical.target # On systems without virtual consoles, don't start ConditionPathExists=/dev/tty7 [Service] User=kodi SupplementaryGroups=tty PAMName=login ExecStart=startx Type=simple Restart=on-abort RestartSec=5 KillMode=control-group # A virtual terminal is needed. TTYPath=/dev/tty7 TTYReset=yes TTYVHangup=yes TTYVTDisallocate=yes # Fail to start if not controlling the tty. StandardOutput=tty StandardInput=tty StandardError=journal # Log this user with utmp, letting it show up with commands 'w' and 'who'. UtmpIdentifier=tty7 UtmpMode=user [Install] WantedBy=graphical.target