add build branch
[openstack-build/neutron-build.git] / debian / quantum-common.postinst
1 #!/bin/sh
2
3 set -e 
4
5 if [ "$1" = "configure" ]
6 then
7         if ! getent group quantum > /dev/null 2>&1
8         then
9                 addgroup --system quantum >/dev/null
10         fi
11         if ! getent passwd quantum > /dev/null 2>&1
12         then
13                 adduser --system --home /var/lib/quantum --ingroup quantum --no-create-home --shell /bin/false quantum
14         fi
15         chown -R quantum:quantum /var/lib/quantum/
16
17         chown -R quantum:adm /var/log/quantum/ 
18         chmod 0750 /var/log/quantum/
19
20     chown -R root:quantum /etc/quantum/
21     chmod 0750 /etc/quantum/
22         chown root:root /etc/quantum/rootwrap.conf
23         chown -R root:root /etc/quantum/rootwrap.d
24         chmod 0755 /etc/quantum/rootwrap.d
25
26         if [ -f /etc/sudoers.d/quantum_sudoers ] ; then
27                 chmod 0440 /etc/sudoers.d/quantum_sudoers
28         fi
29 fi
30
31 #DEBHELPER#