/[pkg-xfce]/goodies/trunk/lightdm/debian/lightdm.postinst
ViewVC logotype

Contents of /goodies/trunk/lightdm/debian/lightdm.postinst

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8613 - (show annotations) (download)
Sun Sep 28 19:57:20 2014 UTC (3 years, 3 months ago) by corsac
File size: 2186 byte(s)
* debian/lightdm.postinst:
  - make sure /var/lib/lightdm always exists.                 closes: #762218
1 #!/bin/sh
2
3 set -e
4
5 . /usr/share/debconf/confmodule
6
7 THIS_PACKAGE=lightdm
8 DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
9
10 # creating lightdm group if he isn't already there
11 if ! getent group lightdm >/dev/null; then
12 addgroup --system lightdm
13 fi
14
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
22 fi
23
24 mkdir -p /var/lib/lightdm
25 chown -R lightdm:lightdm /var/lib/lightdm
26 chmod 0750 /var/lib/lightdm
27
28 # debconf is not a registry, so we only fiddle with the default file if it
29 # does not exist
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
34 $RET="$THIS_PACKAGE"
35 fi
36 if [ "$THIS_PACKAGE" != "$RET" ]; then
37 echo "Please be sure to run \"dpkg --configure $RET\"."
38 fi
39 if db_get "$RET"/daemon_name; then
40 echo "$RET" > $DEFAULT_DISPLAY_MANAGER_FILE
41 fi
42 fi
43 fi
44
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"
48 fi
49
50 # debconf hangs if lightdm gets started below without this
51 db_stop || true
52
53 # update-rc.d levels
54 S=30
55 K=01
56
57 if [ -x /etc/init.d/lightdm ]; then
58 update-rc.d lightdm defaults $S $K >/dev/null 2>&1
59 fi
60
61 if [ "$1" = "configure" ];
62 then
63 invoke-rc.d dbus reload || true
64
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
70 else
71 echo "ERROR: $SERVICE is the selected default display manager but does not exist" >&2
72 fi
73 fi
74 fi
75
76 #DEBHELPER#
77
78 exit 0

  ViewVC Help
Powered by ViewVC 1.1.5