diff options
author | Timothy Redaelli <tredaelli@redhat.com> | 2019-02-11 17:22:53 +0100 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2019-02-11 08:44:04 -0800 |
commit | 1f6daa7311bfe683cb563278a2776d21b8564d8f (patch) | |
tree | 234ab31234be5462ed35e27ae804c21954c1ff2a /utilities | |
parent | a8b12ea59c7e7c32bb041480776c032fe341a0ef (diff) | |
download | openvswitch-1f6daa7311bfe683cb563278a2776d21b8564d8f.tar.gz |
ovs-lib.in: Cleanup old socket and pidfiles in stop_daemon
Currently if a client crashes (signal 11) the unix socket (.ctl) and the
pidfile may not be deleted when you use ovs-ctl stop or restart.
Moreover since ovs-appctl is used on a closed socket some warnings are
printed.
This commit deletes the pidfile and the unix socket then returns without
running ovs-appctl if the pidfile point to a not-existing pid.
Reported-at: https://bugzilla.redhat.com/1667845
Reported-by: Candido Campos <ccamposr@redhat.com>
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'utilities')
-rw-r--r-- | utilities/ovs-lib.in | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/utilities/ovs-lib.in b/utilities/ovs-lib.in index 9a0af2e82..fa840ec63 100644 --- a/utilities/ovs-lib.in +++ b/utilities/ovs-lib.in @@ -235,6 +235,10 @@ start_daemon () { stop_daemon () { if test -e "$rundir/$1.pid"; then if pid=`cat "$rundir/$1.pid"`; then + if pid_exists "$pid" >/dev/null 2>&1; then :; else + rm -f $rundir/$1.$pid.ctl $rundir/$1.$pid + return 0 + fi graceful="EXIT .1 .25 .65 1" actions="TERM .1 .25 .65 1 1 1 1 \ |