[qemu/f13/master] Updates to ksm init scripts.

Justin M. Forbes jforbes at fedoraproject.org
Thu Aug 12 14:19:40 UTC 2010


commit 353d209a2825a1755e28f9cc5dc8551c13380e86
Author: Justin M. Forbes <jforbes at redhat.com>
Date:   Thu Aug 12 09:19:27 2010 -0500

    Updates to ksm init scripts.

 ksm.init      |   26 ++++++++++++++++----------
 ksmtuned.init |    8 ++++----
 qemu.spec     |    3 +--
 3 files changed, 21 insertions(+), 16 deletions(-)
---
diff --git a/ksm.init b/ksm.init
index 0603243..8561993 100644
--- a/ksm.init
+++ b/ksm.init
@@ -40,15 +40,12 @@ default_max_kernel_pages () {
 
 start() {
     echo -n $"Starting $prog: "
-    if [ -f /sys/kernel/mm/ksm/max_kernel_pages ]; then
-        KSM_MAX_KERNEL_PAGES=${KSM_MAX_KERNEL_PAGES:-`default_max_kernel_pages`}
-        echo $KSM_MAX_KERNEL_PAGES > /sys/kernel/mm/ksm/max_kernel_pages
-    fi
+    KSM_MAX_KERNEL_PAGES=${KSM_MAX_KERNEL_PAGES:-`default_max_kernel_pages`}
+    echo $KSM_MAX_KERNEL_PAGES > /sys/kernel/mm/ksm/max_kernel_pages
     echo 1 > /sys/kernel/mm/ksm/run
     RETVAL=$?
     [ $RETVAL = 0 ] && success $"$prog startup" || failure $"$prog startup"
     echo
-    return $RETVAL
 }
 
 stop() {
@@ -72,6 +69,11 @@ status() {
     fi; fi
 }
 
+restart() {
+    stop
+    start
+}
+
 case "$1" in
   start)
 	start
@@ -83,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
diff --git a/ksmtuned.init b/ksmtuned.init
index 2f32f28..e055785 100644
--- a/ksmtuned.init
+++ b/ksmtuned.init
@@ -70,10 +70,10 @@ case "$1" in
         status -p ${pidfile} $prog
 	RETVAL=$?
 	;;
-  restart)
+  restart|force-reload)
 	restart
 	;;
-  condrestart)
+  condrestart|try-restart)
 	condrestart
 	;;
   retune)
@@ -81,8 +81,8 @@ case "$1" in
         RETVAL=$?
         ;;
   *)
-	echo $"Usage: $prog {start|stop|restart|condrestart|status|retune|help}"
-	RETVAL=3
+	echo $"Usage: $prog {start|stop|restart|force-reload|condrestart|try-restart|status|retune|help}"
+	RETVAL=2
 esac
 
 exit $RETVAL
diff --git a/qemu.spec b/qemu.spec
index 15aeb76..44f7bcc 100644
--- a/qemu.spec
+++ b/qemu.spec
@@ -329,8 +329,6 @@ such as kvmtrace and kvm_stat.
 %patch50 -p1
 %patch51 -p1
 %patch52 -p1
-# %patch53 -p1
-# %patch54 -p1
 %patch55 -p1
 
 %build
@@ -639,6 +637,7 @@ fi
 - Fix e1000 gpxe rom requires.
 - Update to 0.12.5 stable for a number of bug fixes.
 - Remove patches already in 0.12.5
+- Updates to ksm init scripts.
 
 * Thu Apr 22 2010 Justin M. Forbes <jforbes at redhat.com> - 2:0.12.3-8
 - Change requires to the noarch seabios-bin


More information about the scm-commits mailing list