diff options
Diffstat (limited to 'recipes-containers/docker/files/docker.init')
| -rw-r--r-- | recipes-containers/docker/files/docker.init | 12 |
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 | ||
| 25 | prog="docker" | 25 | prog="dockerd" |
| 26 | unshare=/usr/bin/unshare | 26 | unshare=/usr/bin/unshare |
| 27 | exec="/usr/bin/$prog" | 27 | exec="/usr/bin/$prog" |
| 28 | pidfile="/var/run/$prog.pid" | 28 | pidfile="/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 | ||
| 85 | rh_status() { | 85 | rh_status() { |
| 86 | status -p $pidfile $prog | 86 | status $prog |
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | rh_status_q() { | 89 | rh_status_q() { |
| @@ -99,24 +99,28 @@ check_for_cleanup() { | |||
| 99 | 99 | ||
| 100 | case "$1" in | 100 | case "$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 | *) |
