This file is indexed.

postinst is in lxdm 0.5.3-2.1.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/sh
# Debian lxdm package post-installation script
# Based on xdm.postinst
# Copyright 1998-2001, 2003, 2004 Branden Robinson.
# Licensed under the GNU General Public License, version 2.  See the file
# /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>.
# Acknowledgements to Stephen Early, Mark Eichin, and Manoj Srivastava.


set -e

# source debconf library
. /usr/share/debconf/confmodule

THIS_PACKAGE=lxdm

DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager

# debconf is not a registry, so we only fiddle with the default file if it
# does not exist
if ! [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" ]; then
  DEFAULT_DISPLAY_MANAGER=
  if db_get shared/default-x-display-manager; then
    DEFAULT_DISPLAY_MANAGER="$RET"
  fi
  if [ -n "$DEFAULT_DISPLAY_MANAGER" ]; then
    DAEMON_NAME=
    if db_get "$DEFAULT_DISPLAY_MANAGER"/daemon_name; then
      DAEMON_NAME="$RET"
    fi
    if [ -z "$DAEMON_NAME" ]; then
      # if we were unable to determine the name of the selected daemon (for
      # instance, if the selected default display manager doesn't provide a
      # daemon_name question), guess
      DAEMON_NAME=$(which "$DEFAULT_DISPLAY_MANAGER" 2>/dev/null)
    fi
    if [ -n "$DAEMON_NAME" ]; then
      echo "$DAEMON_NAME" > "$DEFAULT_DISPLAY_MANAGER_FILE"
    fi
  fi
fi

# Registering the init scripts or starting the daemon may cause output to
# stdout, which can confuse debconf.
db_stop || true

if [ "$1" = "configure" ];
then
  invoke-rc.d dbus reload || true

# set default-display-manager systemd service link according to our config (stolen from lightdm)
  if [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" -a -d /etc/systemd/system/ ]; then
    SERVICE=/lib/systemd/system/$(basename $(cat "$DEFAULT_DISPLAY_MANAGER_FILE")).service
    if [ -e "$SERVICE" ]; then
      ln -sf "$SERVICE" /etc/systemd/system/display-manager.service
    else
      echo "ERROR: $SERVICE is the selected default display manager but does not exist" >&2
    fi
  fi
fi

# Remove alternative file if it's not a symlink, workaround for broken upgrade
# See bug #616188
if [ -f /etc/alternatives/lxdm.conf ] ; then
  if [ ! -h "/etc/alternatives/lxdm.conf" ] ; then
    rm "/etc/alternatives/lxdm.conf"
  fi
fi

# Add /etc/lxdm/lxdm.conf from alternative of lxdm configuration
if [ "$1" = configure ]; then
  update-alternatives --install /etc/lxdm/default.conf \
    lxdm.conf /etc/lxdm/lxdm.conf 50
fi

# Automatically added by dh_installinit/11.1.4ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
	if [ -x "/etc/init.d/lxdm" ]; then
		update-rc.d lxdm defaults 30 01 >/dev/null || exit 1
	fi
fi
# End automatically added section


exit 0