Skip to content

Commit

Permalink
Merge pull request #859 from cgwalters/tail-pdeathsig
Browse files Browse the repository at this point in the history
Bug 1893362: Ensure tail processes exit with parent
  • Loading branch information
openshift-merge-robot committed Nov 4, 2020
2 parents ad49849 + 6588ba7 commit 4720ead
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
8 changes: 7 additions & 1 deletion bindata/network/openshift-sdn/sdn-ovs.yaml
Expand Up @@ -62,8 +62,14 @@ spec:
if [[ ! -S /run/openvswitch/db.sock ]]; then
systemctl_restart ovsdb-server
fi
# We need to explicitly exit on SIGTERM, see https://github.com/openshift/cluster-dns-operator/issues/65
function quit {
exit 0
}
trap quit SIGTERM
# Don't need to worry about restoring flows; this can only change if we've rebooted
exec tail -F /host/var/log/openvswitch/ovs-vswitchd.log /host/var/log/openvswitch/ovsdb-server.log
tail --pid=$BASHPID -F /host/var/log/openvswitch/ovs-vswitchd.log /host/var/log/openvswitch/ovsdb-server.log &
wait
else
echo "openvswitch is running in container"
Expand Down
9 changes: 8 additions & 1 deletion bindata/network/ovn-kubernetes/006-ovs-node.yaml
Expand Up @@ -75,12 +75,19 @@ spec:
if [[ ! -S /run/openvswitch/db.sock ]]; then
systemctl_restart ovsdb-server
fi
# We need to explicitly exit on SIGTERM, see https://github.com/openshift/cluster-dns-operator/issues/65
function quit {
exit 0
}
trap quit SIGTERM
# Don't need to worry about restoring flows; this can only change if we've rebooted
exec tail -F /host/var/log/openvswitch/ovs-vswitchd.log /host/var/log/openvswitch/ovsdb-server.log
tail --pid=$BASHPID -F /host/var/log/openvswitch/ovs-vswitchd.log /host/var/log/openvswitch/ovsdb-server.log &
wait
else
echo "$(date -Iseconds) - starting ovs-daemons"
chown -R openvswitch:openvswitch /run/openvswitch
chown -R openvswitch:openvswitch /etc/openvswitch
# We need to explicitly exit on SIGTERM, see https://github.com/openshift/cluster-dns-operator/issues/65
function quit {
# Don't allow ovs-vswitchd to clear datapath flows on exit
kill -9 $(cat /var/run/openvswitch/ovs-vswitchd.pid 2>/dev/null) 2>/dev/null || true
Expand Down

0 comments on commit 4720ead

Please sign in to comment.