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