autofs-5.0.6 - fix init script usage message From: Ian Kent Changes made to the autofs init script based on lsb compliance resulted in a stupid change where the init script requires users to type: /sbin/service autofs usage to show proper usage. Maybe it was a misunderstanding of the lsb documentation but it is still not sensible. Change to issue the usage message when an umknown parameter is passed but retain the return codes. --- CHANGELOG | 1 + redhat/autofs.init.in | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index e276396..9087fbb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -25,6 +25,7 @@ - fix fix wait for master source mutex. - add sss lookup module. - teach automount about sss source. +- fix init script usage message. 28/06/2011 autofs-5.0.6 ----------------------- diff --git a/redhat/autofs.init.in b/redhat/autofs.init.in index 38b9eeb..0f4a16a 100644 --- a/redhat/autofs.init.in +++ b/redhat/autofs.init.in @@ -151,6 +151,10 @@ function reload() { return $RETVAL } +function usage_message() { + echo $"Usage: $0 {start|forcestart|stop|status|restart|force-reload|forcerestart|reload|condrestart|try-restart}" +} + RETVAL=0 # Only the root user may change the service status @@ -189,11 +193,11 @@ case "$1" in fi ;; usage) - echo $"Usage: $0 {start|forcestart|stop|status|restart|force-reload|forcerestart|reload|condrestart|try-restart}" + usage_message exit 0 ;; *) - echo "unknown, invalid or excess argument(s)" + usage_message exit 2 ;; esac