testenv: Properly kill daemons
authorVolker Lendecke <vl@samba.org>
Mon, 20 Jan 2020 20:22:39 +0000 (21:22 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 21 Jan 2020 14:38:43 +0000 (14:38 +0000)
Without this, all the daemons were kept around

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
selftest/in_screen

index 9a99a3acf7f2f3293cc486cbfac65a79e6fce56e..826cc0420b51d4faaf78dec7452a8128bdea58a4 100755 (executable)
@@ -57,6 +57,13 @@ cleanup() {
        echo "$(date) samba exited with status $status" >> $basedir/$SERVERNAME.log
        exit $status
     }
+
+    case $ENVNAME in
+       *.nmbd|*.smbd|*.winbindd|*.samba)
+           kill $(cat $basedir/../"${ENVNAME%\.*}"/pid/"${ENVNAME##*\.}".pid)
+           ;;
+    esac
+
     read pid < $basedir/$SERVERNAME.pid
     echo "$(date) Killing samba pid $pid from $$" >> $basedir/$SERVERNAME.log
     if [ "$pid" = "$$" ]; then
@@ -86,6 +93,13 @@ fi
 echo "$(date) waiting in $$" >> $basedir/$SERVERNAME.log
 read stdin_var
 echo "$(date) EOF on stdin" >> $basedir/$SERVERNAME.log
+
+case $ENVNAME in
+    *.nmbd|*.smbd|*.winbindd|*.samba)
+       kill $(cat $basedir/../"${ENVNAME%\.*}"/pid/"${ENVNAME##*\.}".pid)
+       ;;
+esac
+
 read pid < $basedir/$SERVERNAME.pid
 echo "$(date) killing $pid" >> $basedir/$SERVERNAME.log
 kill $pid 2> /dev/null