This file is indexed.

preinst is in keystone 1:2014.1.3-0ubuntu2.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
#!/bin/sh

set -e

# summary of how this script can be called:
#        * <new-preinst> `install'
#        * <new-preinst> `install' <old-version>
#        * <new-preinst> `upgrade' <old-version>
#        * <old-preinst> `abort-upgrade' <new-version>

case "$1" in
	install|upgrade)
		# create the keystone group
		if ! getent group keystone > /dev/null 2>&1
		then
			addgroup --system keystone >/dev/null || true
		fi

		# create the keystone user to avoid running keystone as root
		if ! getent passwd keystone > /dev/null 2>&1
		then
			adduser --quiet \
					--system \
					--home /var/lib/keystone \
					--no-create-home \
					--ingroup keystone \
					--shell /bin/false \
					keystone || true
		fi

		if [ "$(id -gn keystone)"  = "nogroup" ]
		then
			usermod -g keystone keystone
		fi

		# create appropriate directories
    		mkdir -p /var/lib/keystone/ /etc/keystone/ /var/log/keystone/

		# change the permissions on key directories
		chown keystone:keystone -R /var/lib/keystone/ /etc/keystone/ /var/log/keystone/
		chmod 0700 /var/lib/keystone/ /var/log/keystone/ /etc/keystone/
		;;
	configure)
	;;
	abort-upgrade)
	;;
	*)
		echo "preinst called with unknown argument  \`$1'" >&2
		exit 0
		;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

# Automatically added by dh_installinit
if [ "$1" = install ] || [ "$1" = upgrade ]; then
	if [ -e "/etc/init.d/keystone" ] && [ -L "/etc/init.d/keystone" ] \
	   && [ $(readlink -f "/etc/init.d/keystone") = /lib/init/upstart-job ]
	then
		rm -f "/etc/init.d/keystone"
	fi
fi
# End automatically added section


exit 0