summaryrefslogtreecommitdiffstats
path: root/recipes-containers/docker/files/docker.init
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 /recipes-containers/docker/files/docker.init
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>
Diffstat (limited to 'recipes-containers/docker/files/docker.init')
-rw-r--r--recipes-containers/docker/files/docker.init12
1 files changed, 8 insertions, 4 deletions
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 *)