| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
set -e |
| 4 |
|
| 5 |
. /usr/share/debconf/confmodule |
| 6 |
|
| 7 |
THIS_PACKAGE=gdm3 |
| 8 |
DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager |
| 9 |
|
| 10 |
# debconf is not a registry, so we only fiddle with the default file if |
| 11 |
# the configure script requested an update |
| 12 |
if [ -e $DEFAULT_DISPLAY_MANAGER_FILE.debconf-update ]; then |
| 13 |
rm -f $DEFAULT_DISPLAY_MANAGER_FILE.debconf-update |
| 14 |
if db_get shared/default-x-display-manager; then |
| 15 |
# workaround debconf passthru bug (#379198) |
| 16 |
if [ -z "$RET" ]; then |
| 17 |
RET="$THIS_PACKAGE" |
| 18 |
fi |
| 19 |
if [ "$THIS_PACKAGE" != "$RET" ]; then |
| 20 |
echo "Please be sure to run \"dpkg --configure $RET\"." |
| 21 |
fi |
| 22 |
if db_get "$RET"/daemon_name; then |
| 23 |
echo "$RET" > $DEFAULT_DISPLAY_MANAGER_FILE |
| 24 |
fi |
| 25 |
fi |
| 26 |
fi |
| 27 |
|
| 28 |
DEFAULT_SERVICE=/etc/systemd/system/display-manager.service |
| 29 |
# set default-display-manager systemd service link according to our config |
| 30 |
if [ "$1" = configure ] && [ -d /etc/systemd/system/ ]; then |
| 31 |
if [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" ]; then |
| 32 |
SERVICE=/lib/systemd/system/$(basename $(cat "$DEFAULT_DISPLAY_MANAGER_FILE")).service |
| 33 |
if [ -h "$DEFAULT_SERVICE" ] && [ $(readlink "$DEFAULT_SERVICE") = /dev/null ]; then |
| 34 |
echo "Display manager service is masked" >&2 |
| 35 |
elif [ -e "$SERVICE" ]; then |
| 36 |
ln -sf "$SERVICE" "$DEFAULT_SERVICE" |
| 37 |
else |
| 38 |
echo "WARNING: $SERVICE is the selected default display manager but does not exist" >&2 |
| 39 |
rm -f "$DEFAULT_SERVICE" |
| 40 |
fi |
| 41 |
else |
| 42 |
rm -f "$DEFAULT_SERVICE" |
| 43 |
fi |
| 44 |
fi |
| 45 |
|
| 46 |
ucf --debconf-ok --three-way /usr/share/gdm/greeter.dconf-defaults /etc/gdm3/greeter.dconf-defaults |
| 47 |
ucfr gdm3 /etc/gdm3/greeter.dconf-defaults |
| 48 |
|
| 49 |
# debconf hangs if gdm3 gets started below without this |
| 50 |
db_stop || true |
| 51 |
|
| 52 |
#DEBHELPER# |
| 53 |
|
| 54 |
if [ -x /etc/init.d/gdm3 ]; then |
| 55 |
update-rc.d gdm3 defaults >/dev/null 2>&1 |
| 56 |
invoke-rc.d gdm3 reload || true |
| 57 |
fi |