1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/hack/make/.integration-daemon-stop
Christy Perez 691ed6ef99 Check for apparmor file before reading it
I ran a single integration test and got an error that the file
/sys/module/apparmor/parameters/enabled doesn't exist. I don't have
apparmor installed. So, just check the file first to avoid a confusing
error.

Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
2015-06-17 11:58:17 -05:00

21 lines
538 B
Bash

#!/bin/bash
trap - EXIT # reset EXIT trap applied in .integration-daemon-start
for pidFile in $(find "$DEST" -name docker.pid); do
pid=$(set -x; cat "$pidFile")
( set -x; kill "$pid" )
if ! wait "$pid"; then
echo >&2 "warning: PID $pid from $pidFile had a nonzero exit code"
fi
done
if [ -z "$DOCKER_TEST_HOST" ]; then
# Stop apparmor if it is enabled
if [ -e "/sys/module/apparmor/parameters/enabled" ] && [ "$(cat /sys/module/apparmor/parameters/enabled)" == "Y" ]; then
(
set -x
/etc/init.d/apparmor stop
)
fi
fi