File: .integration-daemon-stop

package info (click to toggle)
docker.io 20.10.5%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 59,648 kB
  • sloc: sh: 5,527; makefile: 616; ansic: 179; python: 162; asm: 7
file content (35 lines) | stat: -rw-r--r-- 923 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/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