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 "/etc/$proj/$proj.conf" \
26 "/etc/$proj/plugins/ml2/openvswitch_agent.ini" \
28 configs_str=${configs[@]/#/--config-file }
30 [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
32 lockfile=/var/lock/subsys/$prog
35 [ -x $exec ] || exit 5
36 for config in ${configs[@]}; do
37 [ -f $config ] || exit 6
39 runuser -s /bin/bash neutron -c "$exec --log-file /var/log/$proj/ovs-cleanup.log $configs_str &>/dev/null"
49 [ $retval -eq 0 ] && touch $lockfile
54 [ $retval -eq 0 ] && rm -f $lockfile
57 [ ! -f $lockfile ] && retval=3
59 restart|reload|force-reload|condrestart|try-restart)
63 echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"