summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChin Huat Ang <chin.huat.ang@intel.com>2018-11-16 09:31:15 +0800
committerBruce Ashfield <bruce.ashfield@windriver.com>2018-11-20 16:01:38 -0500
commit4ef7f8b758a5c5f105cdf5724e4cf567f968867f (patch)
tree475a1b444729d2fb9fa4f6789748e9af21519873
parentb74c0d4ec270269d155b2b0602da8d8f7eba4dac (diff)
downloadmeta-virtualization-4ef7f8b758a5c5f105cdf5724e4cf567f968867f.tar.gz
docker: fix broken init script
Fix numerous docker.init issues such as missing runtime dependency util-linux-unshare, incomplete handling of start/stop etc. operations and minor typos. Signed-off-by: Chin Huat Ang <chin.huat.ang@intel.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
-rw-r--r--recipes-containers/docker/docker-ce_git.bb2
-rw-r--r--recipes-containers/docker/docker_git.bb2
-rw-r--r--recipes-containers/docker/files/docker.init12
3 files changed, 10 insertions, 6 deletions
diff --git a/recipes-containers/docker/docker-ce_git.bb b/recipes-containers/docker/docker-ce_git.bb
index 7a418508..caf6d704 100644
--- a/recipes-containers/docker/docker-ce_git.bb
+++ b/recipes-containers/docker/docker-ce_git.bb
@@ -62,7 +62,7 @@ DEPENDS = " \
62PACKAGES =+ "${PN}-contrib" 62PACKAGES =+ "${PN}-contrib"
63 63
64DEPENDS_append_class-target = " lvm2" 64DEPENDS_append_class-target = " lvm2"
65RDEPENDS_${PN} = "util-linux iptables \ 65RDEPENDS_${PN} = "util-linux util-linux-unshare iptables \
66 ${@bb.utils.contains('DISTRO_FEATURES', 'aufs', 'aufs-util', '', d)} \ 66 ${@bb.utils.contains('DISTRO_FEATURES', 'aufs', 'aufs-util', '', d)} \
67 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'cgroup-lite', d)} \ 67 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'cgroup-lite', d)} \
68 " 68 "
diff --git a/recipes-containers/docker/docker_git.bb b/recipes-containers/docker/docker_git.bb
index f63cee16..79578083 100644
--- a/recipes-containers/docker/docker_git.bb
+++ b/recipes-containers/docker/docker_git.bb
@@ -67,7 +67,7 @@ PACKAGECONFIG[seccomp] = "seccomp,,libseccomp"
67PACKAGES =+ "${PN}-contrib" 67PACKAGES =+ "${PN}-contrib"
68 68
69DEPENDS_append_class-target = " lvm2" 69DEPENDS_append_class-target = " lvm2"
70RDEPENDS_${PN} = "util-linux iptables \ 70RDEPENDS_${PN} = "util-linux util-linux-unshare iptables \
71 ${@bb.utils.contains('DISTRO_FEATURES', 'aufs', 'aufs-util', '', d)} \ 71 ${@bb.utils.contains('DISTRO_FEATURES', 'aufs', 'aufs-util', '', d)} \
72 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'cgroup-lite', d)} \ 72 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'cgroup-lite', d)} \
73 " 73 "
diff --git a/recipes-containers/docker/files/docker.init b/recipes-containers/docker/files/docker.init
index 2e8eb9e4..0aea8d01 100644
--- a/recipes-containers/docker/files/docker.init
+++ b/recipes-containers/docker/files/docker.init
@@ -22,7 +22,7 @@
22# Source function library. 22# Source function library.
23. /etc/init.d/functions 23. /etc/init.d/functions
24 24
25prog="docker" 25prog="dockerd"
26unshare=/usr/bin/unshare 26unshare=/usr/bin/unshare
27exec="/usr/bin/$prog" 27exec="/usr/bin/$prog"
28pidfile="/var/run/$prog.pid" 28pidfile="/var/run/$prog.pid"
@@ -40,7 +40,7 @@ start() {
40 if ! [ -f $pidfile ]; then 40 if ! [ -f $pidfile ]; then
41 printf "Starting $prog:\t" 41 printf "Starting $prog:\t"
42 echo -e "\n$(date)\n" >> $logfile 42 echo -e "\n$(date)\n" >> $logfile
43 "$unshare" -m -- $exec daemon $other_args &>> $logfile & 43 "$unshare" -m -- $exec $other_args &>> $logfile &
44 pid=$! 44 pid=$!
45 touch $lockfile 45 touch $lockfile
46 # wait up to 10 seconds for the pidfile to exist. see 46 # wait up to 10 seconds for the pidfile to exist. see
@@ -83,7 +83,7 @@ force_reload() {
83} 83}
84 84
85rh_status() { 85rh_status() {
86 status -p $pidfile $prog 86 status $prog
87} 87}
88 88
89rh_status_q() { 89rh_status_q() {
@@ -99,24 +99,28 @@ check_for_cleanup() {
99 99
100case "$1" in 100case "$1" in
101 start) 101 start)
102 rh_status_q && exit 0
102 $1 103 $1
103 ;; 104 ;;
104 stop) 105 stop)
106 rh_status_q || exit 0
105 $1 107 $1
106 ;; 108 ;;
107 restart) 109 restart)
108 $1 110 $1
109 ;; 111 ;;
110 reload) 112 reload)
113 rh_status_q || exit 7
111 $1 114 $1
112 ;; 115 ;;
113 force-reload) 116 force-reload)
114 force_reload 117 force_reload
115 ;; 118 ;;
116 status) 119 status)
117 status 120 rh_status
118 ;; 121 ;;
119 condrestart|try-restart) 122 condrestart|try-restart)
123 rh_status_q || exit 0
120 restart 124 restart
121 ;; 125 ;;
122 *) 126 *)