>From 36e38a206818639237f31daf611ae0f7c83d0abd Mon Sep 17 00:00:00 2001 From: Andrea Arcangeli Date: Fri, 2 Jul 2010 17:35:39 +0200 Subject: [PATCH 1/2] fix some error in ksmd.init return $RETVAL seems unnecessary as nothing checks the retval of the start() function. added condrestart|try-restart and force-reload. Return 2 (3 not) with invalid parameters. Update usage verbs. Signed-off-by: Andrea Arcangeli --- ksm.init | 20 ++++++++++++++------ 1 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ksm.init b/ksm.init index 45d617d..8561993 100644 --- a/ksm.init +++ b/ksm.init @@ -46,7 +46,6 @@ start() { RETVAL=$? [ $RETVAL = 0 ] && success $"$prog startup" || failure $"$prog startup" echo - return $RETVAL } stop() { @@ -70,6 +69,11 @@ status() { fi; fi } +restart() { + stop + start +} + case "$1" in start) start @@ -81,14 +85,18 @@ case "$1" in status ;; restart) - stop - start + restart ;; - condrestart) + condrestart|try-restart) + status >/dev/null 2>&1 || exit 0 + restart ;; + force-reload) + restart + ;; *) - echo $"Usage: $prog {start|stop|restart|condrestart|status|help}" - RETVAL=3 + echo $"Usage: $prog {start|stop|restart|force-reload|condrestart|try-restart|status|help}" + RETVAL=2 esac exit $RETVAL -- 1.7.1