github.com/ssdev-go/moby@v17.12.1-ce-rc2+incompatible/hack/make/.integration-daemon-stop (about)

     1  #!/usr/bin/env bash
     2  
     3  if [ ! "$(go env GOOS)" = 'windows' ]; then
     4  	for pidFile in $(find "$DEST" -name docker.pid); do
     5  		pid=$([ -n "$TESTDEBUG" ] && set -x; cat "$pidFile")
     6  		(
     7  			[ -n "$TESTDEBUG" ] && set -x
     8  			kill "$pid"
     9  		)
    10  		if ! wait "$pid"; then
    11  			echo >&2 "warning: PID $pid from $pidFile had a nonzero exit code"
    12  		fi
    13  	done
    14  
    15  	if [ -z "$DOCKER_TEST_HOST" ]; then
    16  		# Stop apparmor if it is enabled
    17  		if [ -e "/sys/module/apparmor/parameters/enabled" ] && [ "$(cat /sys/module/apparmor/parameters/enabled)" == "Y" ]; then
    18  			(
    19  				[ -n "$TESTDEBUG" ] && set -x
    20  				/etc/init.d/apparmor stop
    21  			)
    22  		fi
    23  	fi
    24  else
    25  	# Note this script is not actionable on Windows to Linux CI. Instead the 
    26  	# DIND daemon under test is torn down by the Jenkins tear-down script
    27  	echo "INFO: Not stopping daemon on Windows CI"
    28  fi