Browse code

contrib: init: use dockerd

Signed-off-by: Antonio Murdaca <runcom@redhat.com>

Antonio Murdaca authored on 2016/04/24 21:27:19
Showing 7 changed files
... ...
@@ -7,7 +7,7 @@
7 7
 #DOCKER_PIDFILE="/run/docker.pid"
8 8
 
9 9
 # where the docker daemon itself is run from
10
-#DOCKER_BINARY="/usr/bin/docker"
10
+#DOCKERD_BINARY="/usr/bin/dockerd"
11 11
 
12 12
 # any other random options you want to pass to docker
13 13
 DOCKER_OPTS=""
... ...
@@ -2,9 +2,9 @@
2 2
 # Copyright 1999-2013 Gentoo Foundation
3 3
 # Distributed under the terms of the GNU General Public License v2
4 4
 
5
-command="${DOCKER_BINARY:-/usr/bin/docker}"
5
+command="${DOCKERD_BINARY:-/usr/bin/dockerd}"
6 6
 pidfile="${DOCKER_PIDFILE:-/run/${RC_SVCNAME}.pid}"
7
-command_args="daemon -p \"${pidfile}\" ${DOCKER_OPTS}"
7
+command_args="-p \"${pidfile}\" ${DOCKER_OPTS}"
8 8
 DOCKER_LOGFILE="${DOCKER_LOGFILE:-/var/log/${RC_SVCNAME}.log}"
9 9
 start_stop_daemon_args="--background \
10 10
 	--stderr \"${DOCKER_LOGFILE}\" --stdout \"${DOCKER_LOGFILE}\""
... ...
@@ -9,7 +9,7 @@ Type=notify
9 9
 # the default is not to use systemd for cgroups because the delegate issues still
10 10
 # exists and systemd currently does not support the cgroup feature set required
11 11
 # for containers run by docker
12
-ExecStart=/usr/bin/docker daemon -H fd://
12
+ExecStart=/usr/bin/dockerd -H fd://
13 13
 ExecReload=/bin/kill -s HUP $MAINPID
14 14
 MountFlags=slave
15 15
 LimitNOFILE=1048576
... ...
@@ -22,7 +22,7 @@ export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
22 22
 BASE=docker
23 23
 
24 24
 # modify these in /etc/default/$BASE (/etc/default/docker)
25
-DOCKER=/usr/bin/$BASE
25
+DOCKERD=/usr/bin/dockerd
26 26
 # This is the pid file managed by docker itself
27 27
 DOCKER_PIDFILE=/var/run/$BASE.pid
28 28
 # This is the pid file created/managed by start-stop-daemon
... ...
@@ -39,8 +39,8 @@ if [ -f /etc/default/$BASE ]; then
39 39
 fi
40 40
 
41 41
 # Check docker is present
42
-if [ ! -x $DOCKER ]; then
43
-	log_failure_msg "$DOCKER not present or not executable"
42
+if [ ! -x $DOCKERD ]; then
43
+	log_failure_msg "$DOCKERD not present or not executable"
44 44
 	exit 1
45 45
 fi
46 46
 
... ...
@@ -103,11 +103,11 @@ case "$1" in
103 103
 		log_begin_msg "Starting $DOCKER_DESC: $BASE"
104 104
 		start-stop-daemon --start --background \
105 105
 			--no-close \
106
-			--exec "$DOCKER" \
106
+			--exec "$DOCKERD" \
107 107
 			--pidfile "$DOCKER_SSD_PIDFILE" \
108 108
 			--make-pidfile \
109 109
 			-- \
110
-				daemon -p "$DOCKER_PIDFILE" \
110
+				-p "$DOCKER_PIDFILE" \
111 111
 				$DOCKER_OPTS \
112 112
 					>> "$DOCKER_LOGFILE" 2>&1
113 113
 		log_end_msg $?
... ...
@@ -8,7 +8,7 @@
8 8
 #
9 9
 
10 10
 # Customize location of Docker binary (especially for development testing).
11
-#DOCKER="/usr/local/bin/docker"
11
+#DOCKERD="/usr/local/bin/dockerd"
12 12
 
13 13
 # Use DOCKER_OPTS to modify the daemon startup options.
14 14
 #DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"
... ...
@@ -22,7 +22,7 @@
22 22
 # Source function library.
23 23
 . /etc/rc.d/init.d/functions
24 24
 
25
-prog="docker"
25
+prog="dockerd"
26 26
 unshare=/usr/bin/unshare
27 27
 exec="/usr/bin/$prog"
28 28
 pidfile="/var/run/$prog.pid"
... ...
@@ -56,7 +56,7 @@ start() {
56 56
         prestart
57 57
         printf "Starting $prog:\t"
58 58
         echo "\n$(date)\n" >> $logfile
59
-        "$unshare" -m -- $exec daemon $other_args >> $logfile 2>&1 &
59
+        "$unshare" -m -- $exec $other_args >> $logfile 2>&1 &
60 60
         pid=$!
61 61
         touch $lockfile
62 62
         # wait up to 10 seconds for the pidfile to exist.  see
... ...
@@ -34,12 +34,12 @@ end script
34 34
 
35 35
 script
36 36
 	# modify these in /etc/default/$UPSTART_JOB (/etc/default/docker)
37
-	DOCKER=/usr/bin/$UPSTART_JOB
37
+	DOCKERD=/usr/bin/dockerd
38 38
 	DOCKER_OPTS=
39 39
 	if [ -f /etc/default/$UPSTART_JOB ]; then
40 40
 		. /etc/default/$UPSTART_JOB
41 41
 	fi
42
-	exec "$DOCKER" daemon $DOCKER_OPTS --raw-logs
42
+	exec "$DOCKERD" $DOCKER_OPTS --raw-logs
43 43
 end script
44 44
 
45 45
 # Don't emit "started" event until docker.sock is ready.