File: tryton-server.postinst

package info (click to toggle)
tryton-server 2.2.4-1%2Bdeb7u2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 3,500 kB
  • sloc: python: 27,407; xml: 4,424; sql: 510; sh: 127; makefile: 79
file content (61 lines) | stat: -rw-r--r-- 2,172 bytes parent folder | download
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
#!/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}
		chmod 0750 ${TRYTON_HOMEDIR}

		# Creating log directory
		mkdir -p ${TRYTON_LOGDIR}
		chown ${TRYTON_USER}:adm ${TRYTON_LOGDIR}
		chmod 0750 ${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}
		chmod 0400 ${TRYTON_CONFFILE}

		echo
		echo "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"
		echo "* Tryton Setup:                                                         *"
		echo "* Tryton uses a database (RDBMS), preferably PostgreSQL to store its    *"
		echo "* data. You have to setup this database manually.                       *"
		echo "* Please read /usr/share/doc/tryton-server/README.Debian how to do it.  *"
		echo "*                                                                       *"
		echo "* Note: If you intend to use solely Neso, the standalone application    *"
		echo "* of Tryton, no database setup is required.                             *"
		echo "*                                                                       *"
		echo "* Tryton Upgrade:                                                       *"
		echo "* On upgrades of major versions (i.e. second number of version string)  *"
		echo "* you have also to run a database update on existing databases.         *"
		echo "* Please read /usr/share/doc/tryton-server/README.Debian how to do it.  *"
		echo "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"
		echo
		;;

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

		;;

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

#DEBHELPER#

exit 0