mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
contrib: init: use dockerd
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
08ec3606f1
commit
1ac1b78b3a
7 changed files with 14 additions and 14 deletions
|
@ -7,7 +7,7 @@
|
||||||
#DOCKER_PIDFILE="/run/docker.pid"
|
#DOCKER_PIDFILE="/run/docker.pid"
|
||||||
|
|
||||||
# where the docker daemon itself is run from
|
# where the docker daemon itself is run from
|
||||||
#DOCKER_BINARY="/usr/bin/docker"
|
#DOCKERD_BINARY="/usr/bin/dockerd"
|
||||||
|
|
||||||
# any other random options you want to pass to docker
|
# any other random options you want to pass to docker
|
||||||
DOCKER_OPTS=""
|
DOCKER_OPTS=""
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
# Copyright 1999-2013 Gentoo Foundation
|
# Copyright 1999-2013 Gentoo Foundation
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
command="${DOCKER_BINARY:-/usr/bin/docker}"
|
command="${DOCKERD_BINARY:-/usr/bin/dockerd}"
|
||||||
pidfile="${DOCKER_PIDFILE:-/run/${RC_SVCNAME}.pid}"
|
pidfile="${DOCKER_PIDFILE:-/run/${RC_SVCNAME}.pid}"
|
||||||
command_args="daemon -p \"${pidfile}\" ${DOCKER_OPTS}"
|
command_args="-p \"${pidfile}\" ${DOCKER_OPTS}"
|
||||||
DOCKER_LOGFILE="${DOCKER_LOGFILE:-/var/log/${RC_SVCNAME}.log}"
|
DOCKER_LOGFILE="${DOCKER_LOGFILE:-/var/log/${RC_SVCNAME}.log}"
|
||||||
start_stop_daemon_args="--background \
|
start_stop_daemon_args="--background \
|
||||||
--stderr \"${DOCKER_LOGFILE}\" --stdout \"${DOCKER_LOGFILE}\""
|
--stderr \"${DOCKER_LOGFILE}\" --stdout \"${DOCKER_LOGFILE}\""
|
||||||
|
|
|
@ -9,7 +9,7 @@ Type=notify
|
||||||
# the default is not to use systemd for cgroups because the delegate issues still
|
# the default is not to use systemd for cgroups because the delegate issues still
|
||||||
# exists and systemd currently does not support the cgroup feature set required
|
# exists and systemd currently does not support the cgroup feature set required
|
||||||
# for containers run by docker
|
# for containers run by docker
|
||||||
ExecStart=/usr/bin/docker daemon -H fd://
|
ExecStart=/usr/bin/dockerd -H fd://
|
||||||
ExecReload=/bin/kill -s HUP $MAINPID
|
ExecReload=/bin/kill -s HUP $MAINPID
|
||||||
MountFlags=slave
|
MountFlags=slave
|
||||||
LimitNOFILE=1048576
|
LimitNOFILE=1048576
|
||||||
|
|
|
@ -22,7 +22,7 @@ export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
|
||||||
BASE=docker
|
BASE=docker
|
||||||
|
|
||||||
# modify these in /etc/default/$BASE (/etc/default/docker)
|
# modify these in /etc/default/$BASE (/etc/default/docker)
|
||||||
DOCKER=/usr/bin/$BASE
|
DOCKERD=/usr/bin/dockerd
|
||||||
# This is the pid file managed by docker itself
|
# This is the pid file managed by docker itself
|
||||||
DOCKER_PIDFILE=/var/run/$BASE.pid
|
DOCKER_PIDFILE=/var/run/$BASE.pid
|
||||||
# This is the pid file created/managed by start-stop-daemon
|
# This is the pid file created/managed by start-stop-daemon
|
||||||
|
@ -39,8 +39,8 @@ if [ -f /etc/default/$BASE ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check docker is present
|
# Check docker is present
|
||||||
if [ ! -x $DOCKER ]; then
|
if [ ! -x $DOCKERD ]; then
|
||||||
log_failure_msg "$DOCKER not present or not executable"
|
log_failure_msg "$DOCKERD not present or not executable"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -103,11 +103,11 @@ case "$1" in
|
||||||
log_begin_msg "Starting $DOCKER_DESC: $BASE"
|
log_begin_msg "Starting $DOCKER_DESC: $BASE"
|
||||||
start-stop-daemon --start --background \
|
start-stop-daemon --start --background \
|
||||||
--no-close \
|
--no-close \
|
||||||
--exec "$DOCKER" \
|
--exec "$DOCKERD" \
|
||||||
--pidfile "$DOCKER_SSD_PIDFILE" \
|
--pidfile "$DOCKER_SSD_PIDFILE" \
|
||||||
--make-pidfile \
|
--make-pidfile \
|
||||||
-- \
|
-- \
|
||||||
daemon -p "$DOCKER_PIDFILE" \
|
-p "$DOCKER_PIDFILE" \
|
||||||
$DOCKER_OPTS \
|
$DOCKER_OPTS \
|
||||||
>> "$DOCKER_LOGFILE" 2>&1
|
>> "$DOCKER_LOGFILE" 2>&1
|
||||||
log_end_msg $?
|
log_end_msg $?
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
# Customize location of Docker binary (especially for development testing).
|
# Customize location of Docker binary (especially for development testing).
|
||||||
#DOCKER="/usr/local/bin/docker"
|
#DOCKERD="/usr/local/bin/dockerd"
|
||||||
|
|
||||||
# Use DOCKER_OPTS to modify the daemon startup options.
|
# Use DOCKER_OPTS to modify the daemon startup options.
|
||||||
#DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"
|
#DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
# Source function library.
|
# Source function library.
|
||||||
. /etc/rc.d/init.d/functions
|
. /etc/rc.d/init.d/functions
|
||||||
|
|
||||||
prog="docker"
|
prog="dockerd"
|
||||||
unshare=/usr/bin/unshare
|
unshare=/usr/bin/unshare
|
||||||
exec="/usr/bin/$prog"
|
exec="/usr/bin/$prog"
|
||||||
pidfile="/var/run/$prog.pid"
|
pidfile="/var/run/$prog.pid"
|
||||||
|
@ -56,7 +56,7 @@ start() {
|
||||||
prestart
|
prestart
|
||||||
printf "Starting $prog:\t"
|
printf "Starting $prog:\t"
|
||||||
echo "\n$(date)\n" >> $logfile
|
echo "\n$(date)\n" >> $logfile
|
||||||
"$unshare" -m -- $exec daemon $other_args >> $logfile 2>&1 &
|
"$unshare" -m -- $exec $other_args >> $logfile 2>&1 &
|
||||||
pid=$!
|
pid=$!
|
||||||
touch $lockfile
|
touch $lockfile
|
||||||
# wait up to 10 seconds for the pidfile to exist. see
|
# wait up to 10 seconds for the pidfile to exist. see
|
||||||
|
|
|
@ -34,12 +34,12 @@ end script
|
||||||
|
|
||||||
script
|
script
|
||||||
# modify these in /etc/default/$UPSTART_JOB (/etc/default/docker)
|
# modify these in /etc/default/$UPSTART_JOB (/etc/default/docker)
|
||||||
DOCKER=/usr/bin/$UPSTART_JOB
|
DOCKERD=/usr/bin/dockerd
|
||||||
DOCKER_OPTS=
|
DOCKER_OPTS=
|
||||||
if [ -f /etc/default/$UPSTART_JOB ]; then
|
if [ -f /etc/default/$UPSTART_JOB ]; then
|
||||||
. /etc/default/$UPSTART_JOB
|
. /etc/default/$UPSTART_JOB
|
||||||
fi
|
fi
|
||||||
exec "$DOCKER" daemon $DOCKER_OPTS --raw-logs
|
exec "$DOCKERD" $DOCKER_OPTS --raw-logs
|
||||||
end script
|
end script
|
||||||
|
|
||||||
# Don't emit "started" event until docker.sock is ready.
|
# Don't emit "started" event until docker.sock is ready.
|
||||||
|
|
Loading…
Reference in a new issue