Browse code

Fix silent failure in RedHat sysvinit script

The docker script in contrib/init/sysvinit-redhat will fail silently on
a start if Docker is not installed in the default /usr/bin/ location.
While a non-zero exit code is returned the user will receive no visible
indication (i.e. error message) as to why Docker was not started.

This commit changes the logic so that in the case that the docker
executable is not found in the expected location or the user does not
have execute permissions on the executable appropriate error messages
are now shown to the user as well as exiting with a non-zero exit code

Signed-off-by: Rob Vesse <rvesse@dotnetrdf.org>

Rob Vesse authored on 2015/08/06 19:57:49
Showing 1 changed files
... ...
@@ -41,7 +41,14 @@ prestart() {
41 41
 }
42 42
 
43 43
 start() {
44
-    [ -x $exec ] || exit 5
44
+    if [ ! -x $exec ]; then
45
+      if [ ! -e $exec ]; then
46
+        echo "Docker executable $exec not found"
47
+      else
48
+        echo "You do not have permission to execute the Docker executable $exec"
49
+      fi	      
50
+      exit 5
51
+    fi
45 52
 
46 53
     check_for_cleanup
47 54