From 99b4d146fb0cf4f3d2449531d7484361028ec5bb Mon Sep 17 00:00:00 2001 From: Will Maier Date: Sun, 31 Jul 2011 14:24:12 +0100 Subject: [PATCH] RedHat: Return status values from client init The init script provided with OpenAFS always returns 0 when the status subcommand is called, even if the service is not running. For example: $ sudo service afs status; echo $? afsd is stopped 0 This change makes sure the init script exits with the value returned by the status function from /etc/init.d/functions. With this patch, the afs init script behaves as expected when used, for example, in a Chef service resource: $ sudo service afs status; echo $? afsd is stopped 3 Reviewed-on: http://gerrit.openafs.org/5123 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear (cherry picked from commit 6b83ba621b520174dc4679c220888619dc0b44a0) Change-Id: I4103875caba88d61c3edf480f3a7e0b24227a319 Reviewed-on: http://gerrit.openafs.org/5231 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/packaging/RedHat/openafs-client.init | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/packaging/RedHat/openafs-client.init b/src/packaging/RedHat/openafs-client.init index 10ec647e0..f07ff1662 100644 --- a/src/packaging/RedHat/openafs-client.init +++ b/src/packaging/RedHat/openafs-client.init @@ -61,6 +61,7 @@ stop() { rhstatus() { status afsd + return $? } restart() { @@ -80,6 +81,7 @@ case "$1" in ;; status) rhstatus + exit $? ;; condrestart) [ -f /var/lock/subsys/openafs-client ] && restart || : -- 2.39.5