This file is indexed.

postinst is in tokyotyrant 1.1.40-4.2.

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
#!/bin/sh -e

NAME=tokyotyrant
USER=$NAME
DATADIR=/var/lib/$NAME
LOGDIR=/var/log/$NAME

. /usr/share/debconf/confmodule

case "$1" in
	configure)
		# creating user if it isn't created
		if ! getent passwd $USER >/dev/null; then
			adduser \
			  --quiet \
			  --system \
			  --disabled-login \
			  --group \
			  --home $DATADIR \
			  --no-create-home \
			  --gecos "Tokyo Tyrant" \
			  --shell /bin/false \
			  $USER
		fi

		# creating group if it isn't created
		if ! getent group $USER >/dev/null; then
			addgroup --quiet --system $USER
			usermod -g $USER $USER
		fi

		# setup permission for data and log directories
		chown -R $USER:$GROUP $DATADIR
		chown -R $USER:$GROUP $LOGDIR
		;;
	*)
		echo "postinst called with unknown argument \`$1'" >&2
		exit 0
		;;
esac

db_stop

# Automatically added by dh_installinit
if [ -x "/etc/init.d/tokyotyrant" ] || [ -e "/etc/init/tokyotyrant.conf" ]; then
	if [ ! -e "/etc/init/tokyotyrant.conf" ]; then
		update-rc.d tokyotyrant defaults >/dev/null
	fi
	invoke-rc.d tokyotyrant start || exit $?
fi
# End automatically added section


exit 0