-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenerp.postinst
30 lines (26 loc) · 910 Bytes
/
openerp.postinst
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
#!/bin/sh
set -e
case "${1}" in
configure)
if ! getent passwd | grep -q "^openerp:"; then
adduser --system --no-create-home --quiet --gecos 'OpenERP' --group openerp
fi
# Register "openerp" as a postgres superuser
su - postgres -c "createuser -s openerp" 2> /dev/null || true
chown openerp:openerp /etc/openerp/openerp-server.conf
chmod 0640 /etc/openerp/openerp-server.conf
# Creating log file
mkdir -p /var/log/openerp/
chown openerp:openerp /var/log/openerp
chmod 0750 /var/log/openerp
# Creating local storage directory
mkdir -p /var/lib/openerp/filestore
chown openerp:openerp -R /var/lib/openerp
# update-python-modules NOW otherwise invoke-rc.d openerp start will fail
update-python-modules -p openerp.public
;;
*)
;;
esac
#DEBHELPER#
exit 0