[meta-virtualization] [PATCH] docker: Fix and update sysvinit script

Jan Kiszka jan.kiszka at web.de
Sun Jul 16 07:48:22 PDT 2017


From: Jan Kiszka <jan.kiszka at siemens.com>

Fix daemonization, align args with docker.service, fix line breaks in
log file - and fix INITSCRIPT_PARAMS (there is no variable
OS_DEFAULT_INITSCRIPT_PARAMS).

Signed-off-by: Jan Kiszka <jan.kiszka at siemens.com>
---
 recipes-containers/docker/docker_git.bb     | 2 +-
 recipes-containers/docker/files/docker.init | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/recipes-containers/docker/docker_git.bb b/recipes-containers/docker/docker_git.bb
index c1b38dc..3d16371 100644
--- a/recipes-containers/docker/docker_git.bb
+++ b/recipes-containers/docker/docker_git.bb
@@ -116,7 +116,7 @@ SYSTEMD_AUTO_ENABLE_${PN} = "enable"
 
 INITSCRIPT_PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','${PN}','',d)}"
 INITSCRIPT_NAME_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','docker.init','',d)}"
-INITSCRIPT_PARAMS_${PN} = "${OS_DEFAULT_INITSCRIPT_PARAMS}"
+INITSCRIPT_PARAMS_${PN} = "defaults"
 
 do_install() {
 	mkdir -p ${D}/${bindir}
diff --git a/recipes-containers/docker/files/docker.init b/recipes-containers/docker/files/docker.init
index 9c01c75..2e8eb9e 100644
--- a/recipes-containers/docker/files/docker.init
+++ b/recipes-containers/docker/files/docker.init
@@ -28,6 +28,7 @@ exec="/usr/bin/$prog"
 pidfile="/var/run/$prog.pid"
 lockfile="/var/lock/subsys/$prog"
 logfile="/var/log/$prog"
+other_args="--registry-mirror=http://localhost:5000 --insecure-registry=http://localhost:5000 --raw-logs"
 
 [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
 
@@ -38,8 +39,8 @@ start() {
 
     if ! [ -f $pidfile ]; then
         printf "Starting $prog:\t"
-        echo "\n$(date)\n" >> $logfile
-        "$unshare" -m -- $exec -d $other_args &>> $logfile &
+        echo -e "\n$(date)\n" >> $logfile
+        "$unshare" -m -- $exec daemon $other_args &>> $logfile &
         pid=$!
         touch $lockfile
         # wait up to 10 seconds for the pidfile to exist.  see
-- 
2.12.3


More information about the meta-virtualization mailing list