rpms/cpuspeed/devel cpuspeed.init, 1.43, 1.44 cpuspeed.spec, 1.76, 1.77

Jarod Wilson jwilson at fedoraproject.org
Wed Jun 10 21:08:01 UTC 2009


Author: jwilson

Update of /cvs/pkgs/rpms/cpuspeed/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv9781

Modified Files:
	cpuspeed.init cpuspeed.spec 
Log Message:
* Wed Jun 10 2009 Jarod Wilson <jarod at redhat.com> 1.5-7
- Fix up lsb compliance a bit (#246895)
- Correct a few more exit codes (rhel5 bz, #495049)



Index: cpuspeed.init
===================================================================
RCS file: /cvs/pkgs/rpms/cpuspeed/devel/cpuspeed.init,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -p -r1.43 -r1.44
--- cpuspeed.init	17 Mar 2009 15:23:48 -0000	1.43
+++ cpuspeed.init	10 Jun 2009 21:07:31 -0000	1.44
@@ -1,9 +1,26 @@
 #!/bin/sh
-# Startup script for cpuspeed
+
+# the following is the LSB init header see
+# http://www.linux-foundation.org/spec//booksets/LSB-Core-generic/LSB-Core-generic.html#INITSCRCOMCONV
+#
+### BEGIN INIT INFO
+# Provides: cpuspeed
+# Should-Start: 
+# Default-Start: 1 2 3 4 5
+# Short-Description: processor frequency scaling support
+# Description: This script enables/disables processor frequency
+#              scaling support, either using the cpuspeed daemon
+#              or in-kernel frequency scaling support
+### END INIT INFO
+
+# the following is the chkconfig init header
+#
+# cpuspeed: processor frequency scaling support
 #
 # chkconfig: 12345 06 99
 # description: Run dynamic CPU speed daemon and/or load appropriate
 #              cpu frequency scaling kernel modules and/or governors
+#
 
 # Source function library.
 . /etc/rc.d/init.d/functions
@@ -37,7 +54,7 @@ some_file_exist() {
 governor_is_module() {
   # Check to see if the requested cpufreq governor
   # is provided as a kernel module or not
-  module_info=`/sbin/modinfo cpufreq-${governor}`
+  module_info=`/sbin/modinfo cpufreq-${governor} > /dev/null 2>&1`
   return $?
 }
 
@@ -88,7 +105,7 @@ start_cpuspeed() {
   else
     DOWN_THRESHOLD=80
   fi
-  OPTS="$OPTS -p $UP_THRESHOLD $DOWN_THRESHOLD"
+  OPTS="$OPTS -r -p $UP_THRESHOLD $DOWN_THRESHOLD"
   if [ -n "$MIN_SPEED" ]; then
     OPTS="$OPTS -m $MIN_SPEED"
   fi
@@ -117,6 +134,11 @@ stop_cpuspeed() {
 }
 
 start() {
+  if [ $(id -u) -ne 0 ]; then
+    echo -n "Insufficient privileges to start cpuspeed service: "
+    failure; echo
+    return 4
+  fi
   if [ ! -f $lockfile ] && [ ! -d "$xendir" ]; then
     cpu_vendor=$(awk '/vendor_id/{print $3}' /proc/cpuinfo | tail -n 1)
     cpu_family=$(awk '/cpu family/{print $4}' /proc/cpuinfo | tail -n 1)
@@ -225,6 +247,11 @@ start() {
 }
 
 stop() {
+  if [ $(id -u) -ne 0 ]; then
+    echo -n "Insufficient privileges to stop cpuspeed service: "
+    failure; echo
+    return 4
+  fi
   is_p4_clockmod && p4status="true"
   if [ "$p4status" == "true" ]; then
     echo "p4-clockmod passive cooling support cannot be stopped"
@@ -285,12 +312,12 @@ case "$1" in
     fi
     ;;
 
-  restart)
+  restart|reload|force-reload)
     stop
     start
     ;;
 
-  condrestart)
+  condrestart|try-restart)
     governor_module_loaded && module_loaded=true
     if [ $module_loaded == true -o -n "`pidof $prog`" -o ${governor} == "performance" ]; then
       stop
@@ -300,7 +327,7 @@ case "$1" in
 
   *)
     echo $"Usage: $0 {start|stop|restart|condrestart|status}"
-    exit 3
+    exit 2
     ;;
 esac
 


Index: cpuspeed.spec
===================================================================
RCS file: /cvs/pkgs/rpms/cpuspeed/devel/cpuspeed.spec,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -p -r1.76 -r1.77
--- cpuspeed.spec	17 Mar 2009 15:23:48 -0000	1.76
+++ cpuspeed.spec	10 Jun 2009 21:07:31 -0000	1.77
@@ -1,7 +1,7 @@
 Summary:        CPU frequency adjusting daemon
 Name:           cpuspeed
 Version:        1.5
-Release:        6%{?dist}
+Release:        7%{?dist}
 Epoch:          1
 Group:          System Environment/Base
 License:        GPLv2+
@@ -81,6 +81,10 @@ fi
 exit 0
 
 %changelog
+* Wed Jun 10 2009 Jarod Wilson <jarod at redhat.com> 1.5-7
+- Fix up lsb compliance a bit (#246895)
+- Correct a few more exit codes (rhel5 bz, #495049)
+
 * Tue Mar 17 2009 Jarod Wilson <jarod at redhat.com> 1.5-6
 - Fix up prior fix-up so that status and stop actually do the right thing
   on NON-p4-clockmod systems




More information about the fedora-extras-commits mailing list