summaryrefslogtreecommitdiff
path: root/utilities/ovs-lib.in
diff options
context:
space:
mode:
authorIlya Maximets <i.maximets@samsung.com>2015-12-16 15:32:21 +0300
committerBen Pfaff <blp@ovn.org>2015-12-16 04:38:11 -0800
commit9b5422a98f817b9f2a1f8224cab7e1a8d0bbba1f (patch)
tree6b2a5f2ad19506a6dd46c5f1108c3d9212150290 /utilities/ovs-lib.in
parent1d7b2eceaeb059e42c1e1cd3d32c192e2ab22271 (diff)
downloadopenvswitch-9b5422a98f817b9f2a1f8224cab7e1a8d0bbba1f.tar.gz
ovs-lib: Try to call exit before killing.
While killing OVS may not free all allocated resources. Example: Socket for vhost-user port will stay in a system after 'systemctl stop openvswitch' and opening that port after restart will fail. Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'utilities/ovs-lib.in')
-rw-r--r--utilities/ovs-lib.in9
1 files changed, 8 insertions, 1 deletions
diff --git a/utilities/ovs-lib.in b/utilities/ovs-lib.in
index dd8a1e931..773efb32c 100644
--- a/utilities/ovs-lib.in
+++ b/utilities/ovs-lib.in
@@ -202,11 +202,18 @@ start_daemon () {
stop_daemon () {
if test -e "$rundir/$1.pid"; then
if pid=`cat "$rundir/$1.pid"`; then
- for action in TERM .1 .25 .65 1 1 1 1 KILL 1 1 1 2 10 15 30 FAIL; do
+ for action in EXIT .1 .25 .65 1 \
+ TERM .1 .25 .65 1 1 1 1 \
+ KILL 1 1 1 2 10 15 30 \
+ FAIL; do
if pid_exists "$pid" >/dev/null 2>&1; then :; else
return 0
fi
case $action in
+ EXIT)
+ action "Exiting $1 ($pid)" \
+ ${bindir}/ovs-appctl -T 1 -t $rundir/$1.$pid.ctl exit
+ ;;
TERM)
action "Killing $1 ($pid)" kill $pid
;;