From dfdfccc5a6e33c4499f0cb242a3ecc6a5926a9be Mon Sep 17 00:00:00 2001 From: Rob Vesse Date: Thu, 6 Aug 2015 11:57:49 +0100 Subject: [PATCH] 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 Upstream-commit: f8387f69042b222e5b0a5d91cf49a840e345f88d Component: engine --- components/engine/contrib/init/sysvinit-redhat/docker | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/engine/contrib/init/sysvinit-redhat/docker b/components/engine/contrib/init/sysvinit-redhat/docker index 6d00e3ca20..6feeb20292 100755 --- a/components/engine/contrib/init/sysvinit-redhat/docker +++ b/components/engine/contrib/init/sysvinit-redhat/docker @@ -41,7 +41,14 @@ prestart() { } start() { - [ -x $exec ] || exit 5 + if [ ! -x $exec ]; then + if [ ! -e $exec ]; then + echo "Docker executable $exec not found" + else + echo "You do not have permission to execute the Docker executable $exec" + fi + exit 5 + fi check_for_cleanup