This file is indexed.

postinst is in tryton-server 3.0.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
#!/bin/sh

set -e

TRYTON_USER="tryton"
TRYTON_CONFFILE="/etc/trytond.conf"
TRYTON_LOGDIR="/var/log/tryton"
TRYTON_HOMEDIR="/var/lib/tryton"

case "${1}" in
	configure)
		# Creating system user
		adduser --home ${TRYTON_HOMEDIR} --no-create-home --quiet --system --group ${TRYTON_USER}

		# Creating home directory (also used for storage of attachments)
		mkdir -p ${TRYTON_HOMEDIR}
		chown ${TRYTON_USER}:${TRYTON_USER} ${TRYTON_HOMEDIR}

		# Creating log directory
		mkdir -p ${TRYTON_LOGDIR}
		chown ${TRYTON_USER}:adm ${TRYTON_LOGDIR}

		# Setting ownership and permissions on configuration file
		# trytond uses internal defaults, if it cannot read the
		# configuration file.
		chown ${TRYTON_USER}:${TRYTON_USER} ${TRYTON_CONFFILE}
		if ! dpkg-statoverride --list "${TRYTON_CONFFILE}" > /dev/null 2>&1
		then
			chmod 0440 "${TRYTON_CONFFILE}"
		fi

		# Restricting access to home and log directories for security reasons (private information)
		for _DIRECTORY in "${TRYTON_HOMEDIR}" "${TRYTON_LOGDIR}"
		do
			if ! dpkg-statoverride --list "${_DIRECTORY}" > /dev/null 2>&1
			then
				chmod 0750 "${_DIRECTORY}"
			fi
		done
		;;

	abort-upgrade|abort-remove|abort-deconfigure)

		;;

	*)
		echo "postinst called with unknown argument \`{$1}'" >&2
		exit 1
		;;
esac


# Automatically added by dhpython:
if which pycompile >/dev/null 2>&1; then
	pycompile -p tryton-server 
fi

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


exit 0