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
Sebastiaan van Stijn 5dbfae6949
hack/make: ignore failure to stop apparmor
```
 ---> Making bundle: .integration-daemon-stop (in bundles/test-integration)
 ++++ cat bundles/test-integration/docker.pid
 +++ kill 13137
 +++ /etc/init.d/apparmor stop
 Leaving: AppArmorNo profiles have been unloaded.

 Unloading profiles will leave already running processes permanently
 unconfined, which can lead to unexpected situations.

 To set a process to complain mode, use the command line tool
 'aa-complain'. To really tear down all profiles, run 'aa-teardown'."

script returned exit code 255
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-01-09 18:52:03 +01:00

32 lines
915 B
Bash

#!/usr/bin/env bash
if [ ! "$(go env GOOS)" = 'windows' ]; then
for pidFile in $(find "$DEST" -name docker.pid); do
pid=$([ -n "$TESTDEBUG" ] && set -x; cat "$pidFile")
(
[ -n "$TESTDEBUG" ] && set -x
kill "$pid"
)
if ! wait "$pid"; then
echo >&2 "warning: PID $pid from $pidFile had a nonzero exit code"
fi
root=$(dirname "$pidFile")/root
if [ -d "$root" ]; then
umount "$root" || true
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
(
[ -n "$TESTDEBUG" ] && set -x
/etc/init.d/apparmor stop || true
)
fi
fi
else
# Note this script is not actionable on Windows to Linux CI. Instead the
# DIND daemon under test is torn down by the Jenkins tear-down script
echo "INFO: Not stopping daemon on Windows CI"
fi