3 # neutron-ovs-cleanup OpenStack Open vSwitch cleanup utility
6 # description: Purge Open vSwitch of the Neutron devices
8 # This is a one-shot init.d script with the next properties:
10 # * It accepts 3 verbs: start, stop, status
11 # * It cleans unused resources during start (system or agents startup)
12 # * It cleans everything on stop (agents migration to other hosts)
13 # * Once started, it will respond with status = OK
14 # * Once stopped, it will respond with status = DEAD
18 . /etc/rc.d/init.d/functions
21 prog=$proj-ovs-cleanup
23 pidfile="/var/run/$proj/$prog.pid"
25 "/usr/share/$proj/$proj-dist.conf" \
26 "/etc/$proj/$proj.conf" \
27 "/etc/$proj/plugins/openvswitch/ovs_neutron_plugin.ini" \
29 configs_str=${configs[@]/#/--config-file }
31 [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
33 lockfile=/var/lock/subsys/$prog
36 [ -x $exec ] || exit 5
37 for config in ${configs[@]}; do
38 [ -f $config ] || exit 6
40 runuser -s /bin/bash neutron -c "$exec --log-file /var/log/$proj/ovs-cleanup.log $configs_str &>/dev/null"
50 [ $retval -eq 0 ] && touch $lockfile
55 [ $retval -eq 0 ] && rm -f $lockfile
58 [ ! -f $lockfile ] && retval=3
60 restart|reload|force-reload|condrestart|try-restart)
64 echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"