From 6f8fdb8aa893b2d5f319d342614dd159e0c8bb83 Mon Sep 17 00:00:00 2001 From: Jeff Minard Date: Tue, 21 Jul 2015 16:35:24 -0700 Subject: [PATCH] Allow RHEL init script to detect daemon start pid failure If you have some kind of bogus `other_args` in `/etc/sysconfig/docker` the start script will report "started" but it's full of lies. This enhances the flow so that if the pidfile never shows up (failure to start) you get a proper failure message. I also added dots for fun. Signed-off-by: Jeff Minard --- contrib/init/sysvinit-redhat/docker | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/contrib/init/sysvinit-redhat/docker b/contrib/init/sysvinit-redhat/docker index d51e2f8ba1..d2ae75fc11 100755 --- a/contrib/init/sysvinit-redhat/docker +++ b/contrib/init/sysvinit-redhat/docker @@ -58,7 +58,13 @@ start() { while [ ! -f $pidfile -a $tries -lt 10 ]; do sleep 1 tries=$((tries + 1)) + echo -n '.' done + if [ ! -f $pidfile ]; then + failure + echo + exit 1 + fi success echo else