From 6b83ba621b520174dc4679c220888619dc0b44a0 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 Change-Id: If3d317fc406746f357e29e0d8d82c7ccf3c192d7 Reviewed-on: http://gerrit.openafs.org/5123 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