summaryrefslogtreecommitdiffstats
path: root/recipes-containers/docker/files/docker.init
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2020-06-30 23:21:42 -0400
committerBruce Ashfield <bruce.ashfield@gmail.com>2020-07-01 12:43:16 -0400
commit929372946aeb85953d1ca6acc428d73fbac52a56 (patch)
tree8198a14178180fc5c522a7a4756e74938497555f /recipes-containers/docker/files/docker.init
parent9726c5d16420c525afe6045665c6aeaf424d9cc6 (diff)
downloadmeta-virtualization-929372946aeb85953d1ca6acc428d73fbac52a56.tar.gz
docker-ce/docker-moby: fixup GO compiler calls
With oe-core commit c23f9e80492e4b [tcmode-default: use go-binary-native by default], we must explictly call the proper cross go binary, versus just the go-native variant. These builds were working by luck, since the go compiler was capable of building the target binaries previously (in its build-from-source creation). We fixup the calls and we no longer see fpu build issues: fatal error: gnu/stubs-soft.h: No such file or directory 7 | # include <gnu/stubs-soft.h> | ^~~~~~~~~~~~~~~~~~ This commit also moves the docker-ce patches from "files" to a named directory to reduce confusion. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-containers/docker/files/docker.init')
-rw-r--r--recipes-containers/docker/files/docker.init131
1 files changed, 0 insertions, 131 deletions
diff --git a/recipes-containers/docker/files/docker.init b/recipes-containers/docker/files/docker.init
deleted file mode 100644
index 24f8fea6..00000000
--- a/recipes-containers/docker/files/docker.init
+++ /dev/null
@@ -1,131 +0,0 @@
1#!/bin/sh
2#
3# /etc/rc.d/init.d/docker
4#
5# Daemon for docker.com
6#
7# chkconfig: 2345 95 95
8# description: Daemon for docker.com
9
10### BEGIN INIT INFO
11# Provides: docker
12# Required-Start: $network cgconfig
13# Required-Stop:
14# Should-Start:
15# Should-Stop:
16# Default-Start: 2 3 4 5
17# Default-Stop: 0 1 6
18# Short-Description: start and stop docker
19# Description: Daemon for docker.com
20### END INIT INFO
21
22# Source function library.
23. /etc/init.d/functions
24
25prog="dockerd"
26unshare=/usr/bin/unshare
27exec="/usr/bin/$prog"
28pidfile="/var/run/$prog.pid"
29lockfile="/var/lock/subsys/$prog"
30logfile="/var/log/$prog"
31other_args="--pidfile $pidfile --registry-mirror=http://localhost:5000 --insecure-registry=http://localhost:5000 --raw-logs"
32
33[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
34
35start() {
36 [ -x $exec ] || exit 5
37
38 check_for_cleanup
39
40 if ! [ -f $pidfile ]; then
41 printf "Starting $prog:\t"
42 echo -e "\n$(date)\n" >> $logfile
43 "$unshare" -m -- $exec $other_args >> $logfile 2>&1 &
44 pid=$!
45 touch $lockfile
46 # wait up to 10 seconds for the pidfile to exist. see
47 # https://github.com/docker/docker/issues/5359
48 tries=0
49 while [ ! -f $pidfile -a $tries -lt 10 ]; do
50 sleep 1
51 tries=$((tries + 1))
52 done
53 success
54 echo
55 else
56 failure
57 echo
58 printf "$pidfile still exists...\n"
59 exit 7
60 fi
61}
62
63stop() {
64 echo -n $"Stopping $prog: "
65 killproc $prog
66 retval=$?
67 echo
68 [ $retval -eq 0 ] && rm -f $lockfile
69 return $retval
70}
71
72restart() {
73 stop
74 start
75}
76
77reload() {
78 restart
79}
80
81force_reload() {
82 restart
83}
84
85rh_status() {
86 status $prog
87}
88
89rh_status_q() {
90 rh_status >/dev/null 2>&1
91}
92
93
94check_for_cleanup() {
95 if [ -f ${pidfile} ]; then
96 /bin/ps -fp $(cat ${pidfile}) > /dev/null || rm ${pidfile}
97 fi
98}
99
100case "$1" in
101 start)
102 rh_status_q && exit 0
103 $1
104 ;;
105 stop)
106 rh_status_q || exit 0
107 $1
108 ;;
109 restart)
110 $1
111 ;;
112 reload)
113 rh_status_q || exit 7
114 $1
115 ;;
116 force-reload)
117 force_reload
118 ;;
119 status)
120 rh_status
121 ;;
122 condrestart|try-restart)
123 rh_status_q || exit 0
124 restart
125 ;;
126 *)
127 echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
128 exit 2
129esac
130
131exit $?