prole/infrastructure/roles/dashboard/templates/dashboard.service.j2

41 lines
1.0 KiB
Django/Jinja

[Unit]
Description=Prole console dashboard (X + conky)
After=systemd-user-sessions.service
Wants=systemd-user-sessions.service
# If a graphical desktop is running, starting this service will stop it.
Conflicts=graphical.target
Before=graphical.target
# If a getty is running on the dashboard VT, stop it so Xorg can take over.
Conflicts=getty@tty{{ dashboard_vt }}.service
[Service]
Type=simple
# Attach the service to the dashboard VT so Xorg can take over the display.
TTYPath=/dev/tty{{ dashboard_vt }}
StandardInput=tty
StandardOutput=journal+console
StandardError=journal+console
TTYReset=yes
TTYVHangup=yes
TTYVTDisallocate=yes
Environment=DASHBOARD_VT={{ dashboard_vt }}
ExecStart={{ dashboard_script_dest }}
# When the dashboard stops, try to restore the login prompt on that VT.
ExecStopPost=-/usr/bin/systemctl --no-block start getty@tty{{ dashboard_vt }}.service
Restart=always
RestartSec=2
# Ensure X/conky are terminated when the service stops.
KillMode=control-group
TimeoutStopSec=10
[Install]
WantedBy=multi-user.target