Skip to content

Commit 86a4ceb

Browse files
committed
At dpkg postinst, ask for reboot instead of killing desktop
Instead of killing the user sessions and any desktop environments, notify the user about that a reboot is required to apply changes to /etc/logind.conf. Fixes #25
1 parent 9a547e2 commit 86a4ceb

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

configs/linux/postinst.sh

+12-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,18 @@ if ! grep -q '^user_allow_other$' /etc/fuse.conf; then
77
fi
88

99
# Pick up changes to /etc/logind.conf.
10-
systemctl restart systemd-logind.service
10+
if [ -z "$(loginctl --no-legend list-sessions)" ]; then
11+
systemctl restart systemd-logind.service
12+
else
13+
# Restarting systemd-logind.service effectively kills user sessions and the
14+
# users' desktop environment, so let the user get a hint about reboot
15+
# instead.
16+
/usr/share/update-notifier/notify-reboot-required
17+
if [ -e /var/run/reboot-required ]; then
18+
cat /var/run/reboot-required
19+
fi
20+
echo "Please reboot to apply changes to /etc/logind.conf"
21+
fi
1122

1223
# Pick up changes to the systemd service.
1324
systemctl daemon-reload

0 commit comments

Comments
 (0)