github.com/shiroyuki/docker@v1.9.0/hack/make/.integration-daemon-stop (about)

     1  #!/bin/bash
     2  
     3  trap - EXIT # reset EXIT trap applied in .integration-daemon-start
     4  
     5  for pidFile in $(find "$DEST" -name docker.pid); do
     6  	pid=$(set -x; cat "$pidFile")
     7  	( set -x; kill "$pid" )
     8  	if ! wait "$pid"; then
     9  		echo >&2 "warning: PID $pid from $pidFile had a nonzero exit code"
    10  	fi
    11  done
    12  
    13  if [ -z "$DOCKER_TEST_HOST" ]; then
    14  	# Stop apparmor if it is enabled
    15  	if [ -e "/sys/module/apparmor/parameters/enabled" ] && [ "$(cat /sys/module/apparmor/parameters/enabled)" == "Y" ]; then
    16  		(
    17  			set -x
    18  			/etc/init.d/apparmor stop
    19  		)
    20  	fi
    21  fi