Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LightDM failsafe handler and restart directives #340

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions debian/lightdm-failure-handler.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Unit]
Description=Handle LightDM failure

[Service]
Type=oneshot
ExecStart=/bin/mv /etc/issue /etc/issue.restore; /bin/sh -c 'echo -e "LightDM has failed to start. You are now in a TTY for troubleshooting...\nYou can log in and check for details in logs." > /etc/issue; /usr/bin/chvt 4'

[Install]
WantedBy=multi-user.target
11 changes: 11 additions & 0 deletions debian/lightdm-success-handler.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=Reset /etc/issue after LightDM starts successfully
Requires=lightdm.service
After=lightdm.service

[Service]
Type=oneshot
ExecStart=/bin/sh -c 'test -f /etc/issue.restore && mv /etc/issue.restore /etc/issue || echo "File /etc/issue.restore not found. No restore action needed."'

[Install]
WantedBy=graphical.target
4 changes: 4 additions & 0 deletions debian/lightdm.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ Description=Light Display Manager
Documentation=man:lightdm(1)
[email protected] plymouth-quit.service
After=systemd-user-sessions.service [email protected] plymouth-quit.service systemd-hostnamed.service
StartLimitIntervalSec=60s
StartLimitBurst=5
OnFailure=lightdm-failure-handler.service

[Service]
# temporary safety check until all DMs are converted to correct
# display-manager.service symlink handling
ExecStartPre=/bin/sh -c '[ "$(basename $(cat /etc/X11/default-display-manager 2>/dev/null))" = "lightdm" ]'
ExecStart=/usr/sbin/lightdm
Restart=always
RestartSec=5s
BusName=org.freedesktop.DisplayManager
Loading