commit 8fd8434e78d36d649fa8599cb4b717bd88d750a1 Author: Jan Pokorny jpokorny@redhat.com Date: Fri Aug 26 11:54:33 2011 +0200
initscript: make distinction of status/non-status action retval
Functionally the same at the moment (due to 'entry_check' returning solely 4 to signal a failure), but the fact that 'status' action is unique wrt. its return value should not get lost:
status action [1]: program or service status is unknown non-status actions [2]: user had insufficient privilege
The change ensures that return values are as expected even if 'entry_check' modified to return various values to signal a failure.
[1] http://fedoraproject.org/wiki/Packaging:SysVInitScript#Exit_Codes_for_the_St... [2] http://fedoraproject.org/wiki/Packaging:SysVInitScript#Exit_Codes_for_non-St...
Signed-off-by: Jan Pokorny jpokorny@redhat.com
input_files/initscript/initscript.in | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) --- diff --git a/input_files/initscript/initscript.in b/input_files/initscript/initscript.in index 414d8c5..cbb3423 100755 --- a/input_files/initscript/initscript.in +++ b/input_files/initscript/initscript.in @@ -489,7 +489,7 @@ case "$1" in $1 ;; backup-db) - entry_check || exit 4 + entry_check || exit $? status &>/dev/null if [ $? -eq 0 ]; then $ECHOFUNC "The database backup operation can proceed only when @SERVICENAME@ is stopped. Stop @SERVICENAME@, then try again." >&2 @@ -500,7 +500,7 @@ case "$1" in exit $? ;; restore-db) - entry_check || exit 4 + entry_check || exit $? status &>/dev/null if [ $? -eq 0 ]; then $ECHOFUNC "The database restore operation can proceed only when @SERVICENAME@ is stopped. Stop @SERVICENAME@, then try again." >&2 @@ -511,7 +511,7 @@ case "$1" in exit $? ;; list-backups) - entry_check || exit 4 + entry_check || exit $? list_database_dumps exit $? ;;
luci-commits@lists.fedorahosted.org