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 <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
6b83ba621b520174dc4679c220888619dc0b44a0)
Change-Id: I4103875caba88d61c3edf480f3a7e0b24227a319
Reviewed-on: http://gerrit.openafs.org/5231
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
rhstatus() {
status afsd
+ return $?
}
restart() {
;;
status)
rhstatus
+ exit $?
;;
condrestart)
[ -f /var/lock/subsys/openafs-client ] && restart || :