Skip to content

Commit

Permalink
ovs-lib: Try to call exit before killing.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
igsilya authored and blp committed Dec 16, 2015
1 parent 1d7b2ec commit 9b5422a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion utilities/ovs-lib.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
;;
Expand Down

0 comments on commit 9b5422a

Please sign in to comment.