diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2017-07-16 16:48:22 +0200 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2017-07-17 15:48:43 -0400 |
commit | de50b560876d1bb3fdc0a4e87b09a1790745e0a2 (patch) | |
tree | 03baa7b335d89a250becdfc752a3a3f112e520e1 | |
parent | be934f72d2758b6a71438633392dd14352db39f8 (diff) | |
download | meta-virtualization-de50b560876d1bb3fdc0a4e87b09a1790745e0a2.tar.gz |
docker: Fix and update sysvinit script
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@siemens.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
-rw-r--r-- | recipes-containers/docker/docker_git.bb | 2 | ||||
-rw-r--r-- | 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 16ebd210..1ced8f47 100644 --- a/recipes-containers/docker/docker_git.bb +++ b/recipes-containers/docker/docker_git.bb | |||
@@ -122,7 +122,7 @@ SYSTEMD_AUTO_ENABLE_${PN} = "enable" | |||
122 | 122 | ||
123 | INITSCRIPT_PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','${PN}','',d)}" | 123 | INITSCRIPT_PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','${PN}','',d)}" |
124 | INITSCRIPT_NAME_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','docker.init','',d)}" | 124 | INITSCRIPT_NAME_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','docker.init','',d)}" |
125 | INITSCRIPT_PARAMS_${PN} = "${OS_DEFAULT_INITSCRIPT_PARAMS}" | 125 | INITSCRIPT_PARAMS_${PN} = "defaults" |
126 | 126 | ||
127 | do_install() { | 127 | do_install() { |
128 | mkdir -p ${D}/${bindir} | 128 | mkdir -p ${D}/${bindir} |
diff --git a/recipes-containers/docker/files/docker.init b/recipes-containers/docker/files/docker.init index 9c01c758..2e8eb9e4 100644 --- a/recipes-containers/docker/files/docker.init +++ b/recipes-containers/docker/files/docker.init | |||
@@ -28,6 +28,7 @@ exec="/usr/bin/$prog" | |||
28 | pidfile="/var/run/$prog.pid" | 28 | pidfile="/var/run/$prog.pid" |
29 | lockfile="/var/lock/subsys/$prog" | 29 | lockfile="/var/lock/subsys/$prog" |
30 | logfile="/var/log/$prog" | 30 | logfile="/var/log/$prog" |
31 | other_args="--registry-mirror=http://localhost:5000 --insecure-registry=http://localhost:5000 --raw-logs" | ||
31 | 32 | ||
32 | [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog | 33 | [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog |
33 | 34 | ||
@@ -38,8 +39,8 @@ start() { | |||
38 | 39 | ||
39 | if ! [ -f $pidfile ]; then | 40 | if ! [ -f $pidfile ]; then |
40 | printf "Starting $prog:\t" | 41 | printf "Starting $prog:\t" |
41 | echo "\n$(date)\n" >> $logfile | 42 | echo -e "\n$(date)\n" >> $logfile |
42 | "$unshare" -m -- $exec -d $other_args &>> $logfile & | 43 | "$unshare" -m -- $exec daemon $other_args &>> $logfile & |
43 | pid=$! | 44 | pid=$! |
44 | touch $lockfile | 45 | touch $lockfile |
45 | # wait up to 10 seconds for the pidfile to exist. see | 46 | # wait up to 10 seconds for the pidfile to exist. see |