5 if dpkg-maintscript-helper supports mv_conffile; then
6 dpkg-maintscript-helper mv_conffile \
8 /etc/lightdm/lightdm.conf \
12 . /usr/share/debconf/confmodule
15 DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
17 # creating lightdm group if he isn't already there
18 if ! getent group lightdm >/dev/null; then
19 addgroup --system lightdm
22 # creating lightdm user if he isn't already there
23 if ! getent passwd lightdm >/dev/null; then
24 adduser --system --ingroup lightdm --home /var/lib/lightdm lightdm
25 usermod -c "Light Display Manager" lightdm
26 usermod -d "/var/lib/lightdm" lightdm
27 usermod -g "lightdm" lightdm
28 usermod -s "/bin/false" lightdm
31 # Creating nopasswdlogin group if he isn't already there.
32 # That enables the password-less login feature in the users-admin
33 # tool of the gnome-system-tools for users that belong to it,
34 # and which is working thanks to LightDM's PAM policy.
35 if ! getent group nopasswdlogin >/dev/null; then
36 addgroup --system nopasswdlogin
39 if [ -d /var/lib/lightdm ]; then
40 chown -R lightdm:lightdm /var/lib/lightdm || true
41 chmod 0750 /var/lib/lightdm
44 # debconf is not a registry, so we only fiddle with the default file if it
46 if ! [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" ]; then
47 DEFAULT_DISPLAY_MANAGER=
48 if db_get shared/default-x-display-manager; then
49 DEFAULT_DISPLAY_MANAGER="$RET"
51 if [ -n "$DEFAULT_DISPLAY_MANAGER" ]; then
53 if db_get "$DEFAULT_DISPLAY_MANAGER"/daemon_name; then
56 if [ -z "$DAEMON_NAME" ]; then
57 # if we were unable to determine the name of the selected daemon (for
58 # instance, if the selected default display manager doesn't provide a
59 # daemon_name question), guess
60 DAEMON_NAME=$(which "$DEFAULT_DISPLAY_MANAGER" 2>/dev/null)
62 if [ -n "$DAEMON_NAME" ]; then
63 echo "$DAEMON_NAME" > "$DEFAULT_DISPLAY_MANAGER_FILE"
68 # Registering the init scripts or starting the daemon may cause output to
69 # stdout, which can confuse debconf.
72 DEFAULT_SERVICE=/etc/systemd/system/display-manager.service
73 # set default-display-manager systemd service link according to our config
74 if [ "$1" = configure ] && [ -d /etc/systemd/system/ ]; then
75 if [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" ]; then
76 SERVICE=/lib/systemd/system/$(basename $(cat "$DEFAULT_DISPLAY_MANAGER_FILE")).service
77 if [ -h "$DEFAULT_SERVICE" ] && [ $(readlink "$DEFAULT_SERVICE") = /dev/null ]; then
78 echo "Display manager service is masked" >&2
79 elif [ -e "$SERVICE" ]; then
80 ln -sf "$SERVICE" "$DEFAULT_SERVICE"
82 echo "WARNING: $SERVICE is the selected default display manager but does not exist" >&2
83 rm -f "$DEFAULT_SERVICE"
86 rm -f "$DEFAULT_SERVICE"
93 if dpkg --compare-versions "$2" lt "1.7.0-0ubuntu6" ; then
94 if [ -f /etc/apparmor.d/abstractions/lightdm ]; then
95 chmod 0644 /etc/apparmor.d/abstractions/lightdm || true
97 if [ -f /etc/apparmor.d/abstractions/lightdm_chromium-browser ]; then
98 chmod 0644 /etc/apparmor.d/abstractions/lightdm_chromium-browser || true