Update specs for the latest stable/kilo sources
[openstack-build/neutron-build.git] / trusty / 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     # NOTE(jamespage): In order to execute unit test in decomposed
22     #                  vendor drivers, /etc/neutron must be readable
23     #                  other than by root or neutron; limitation of
24     #                  access to neutron.conf is sufficient as this
25     #                  file contains access details for DB, keystone
26     #                  and message bus.
27     chmod 0755 /etc/neutron/
28     chmod -f 0640 /etc/neutron/neutron.conf || :
29         chown root:root /etc/neutron/rootwrap.conf
30         chown -R root:root /etc/neutron/rootwrap.d
31         chmod 0755 /etc/neutron/rootwrap.d
32
33         if [ -f /etc/sudoers.d/neutron_sudoers ] ; then
34                 chmod 0440 /etc/sudoers.d/neutron_sudoers
35         fi
36 fi
37
38 #DEBHELPER#