5 . /usr/share/debconf/confmodule
8 DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
10 # creating lightdm group if he isn't already there
11 if ! getent group lightdm >/dev/null; then
12 addgroup --system lightdm
15 # creating lightdm user if he isn't already there
16 if ! getent passwd lightdm >/dev/null; then
17 adduser --system --ingroup lightdm --home /var/lib/lightdm lightdm
18 usermod -c "Light Display Manager" lightdm
19 usermod -d "/var/lib/lightdm" lightdm
20 usermod -g "lightdm" lightdm
21 usermod -s "/bin/false" lightdm
24 mkdir -p /var/lib/lightdm
25 chown -R lightdm:lightdm /var/lib/lightdm
26 chmod 0750 /var/lib/lightdm
28 # debconf is not a registry, so we only fiddle with the default file if it
30 if [ ! -e "$DEFAULT_DISPLAY_MANAGER_FILE" ]; then
31 if db_get shared/default-x-display-manager; then
32 # workaround debconf passthru bug (#379198)
33 if [ -z "$RET" ]; then
36 if [ "$THIS_PACKAGE" != "$RET" ]; then
37 echo "Please be sure to run \"dpkg --configure $RET\"."
39 if db_get "$RET"/daemon_name; then
40 echo "$RET" > $DEFAULT_DISPLAY_MANAGER_FILE
45 # remove the displaced old default display manager file if it exists
46 if [ -e "$DEFAULT_DISPLAY_MANAGER_FILE.dpkg-tmp" ]; then
47 rm "$DEFAULT_DISPLAY_MANAGER_FILE.dpkg-tmp"
50 # debconf hangs if lightdm gets started below without this
57 if [ -x /etc/init.d/lightdm ]; then
58 update-rc.d lightdm defaults $S $K >/dev/null 2>&1
61 if [ "$1" = "configure" ];
63 invoke-rc.d dbus reload || true
65 # set default-display-manager systemd service link according to our config
66 if [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" -a -d /etc/systemd/system/ ]; then
67 SERVICE=/lib/systemd/system/$(basename $(cat "$DEFAULT_DISPLAY_MANAGER_FILE")).service
68 if [ -e "$SERVICE" ]; then
69 ln -sf "$SERVICE" /etc/systemd/system/display-manager.service
71 echo "ERROR: $SERVICE is the selected default display manager but does not exist" >&2