summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorBalbir Singh <balbir@linux.vnet.ibm.com>2008-10-15 04:20:29 +0000
committerBalbir Singh <balbir@linux.vnet.ibm.com>2008-10-15 04:20:29 +0000
commit24ab0821ee1bf644e08aeff6c0ea7429249412be (patch)
tree7e30c0fecb141d4005e6e1bde8eba429dd67c87a /scripts
parent93916877edf5104352ee7a7136d55d5c0fe57001 (diff)
downloadlibcg-24ab0821ee1bf644e08aeff6c0ea7429249412be.zip
libcg-24ab0821ee1bf644e08aeff6c0ea7429249412be.tar.gz
libcg-24ab0821ee1bf644e08aeff6c0ea7429249412be.tar.xz
Merge several bug-fixes and cleanups. No version bump yet, since this is
an ongoing exercise (after more testing, I'll recommend one). Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@216 4f4bb910-9a46-0410-90c8-c897d4f1cd53
Diffstat (limited to 'scripts')
-rw-r--r--scripts/init.d/cgconfig36
-rw-r--r--scripts/init.d/cgred2
2 files changed, 29 insertions, 9 deletions
diff --git a/scripts/init.d/cgconfig b/scripts/init.d/cgconfig
index 1a8ca42..4e04fb9 100644
--- a/scripts/init.d/cgconfig
+++ b/scripts/init.d/cgconfig
@@ -1,3 +1,4 @@
+#!/bin/bash
#
# Start/Stop the workload manager
#
@@ -12,8 +13,13 @@
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
+# cgconfig Control Groups Configuration Startup
+# chkconfig: 2345 80 20
+# description: This script runs the cgconfigparser utility to parse and setup
+# the control group filesystem. It uses /etc/cgconfig.conf
+# and parses the configuration specified in there.
-#### BEGIN INIT INFO
+### BEGIN INIT INFO
# Provides: cgconfig
# Required-Start: $local_fs $syslog $time
# Required-Stop: $local_fs $syslog
@@ -23,7 +29,7 @@
# Default-Stop: 0 1 6
# Short-Description: start and stop the WLM configuration
# Description: This script allows us to create a default configuration
-#### END INIT INFO
+### END INIT INFO
PATH=/bin:/usr/bin:/sbin:/usr/sbin:.
MOUNTS_FILE=/proc/mounts
@@ -35,6 +41,7 @@ CONFIG_FILE=/etc/cgconfig.conf
declare -a MOUNTPOINT
declare -a MOUNTOPTS
maxindex=0
+servicename=cgconfig
#
# Source LSB routines
@@ -64,7 +71,7 @@ umount_fs() {
}
start() {
- if [ -f /var/lock/cgconfig ]
+ if [ -f /var/lock/subsys/$servicename ]
then
log_warning_msg "lock file already exists"
return
@@ -72,10 +79,10 @@ start() {
if [ $? -eq 0 ]
then
- log_progress_msg "Starting cgconfig service: "
+ #log_progress_msg "Starting cgconfig service: "
cgconfigparser -l $CONFIG_FILE
fi
- [ $? == 0 ] && touch /var/lock/cgconfig
+ [ $? == 0 ] && touch /var/lock/subsys/$servicename
return $?
}
@@ -97,7 +104,7 @@ move_all_to_init_class() {
;;
*)
class=${i#./*}
- log_progress_msg "Removing class $class"
+ #log_progress_msg "Removing class $class"
sed -nu p < ./$i/tasks > tasks
rmdir $i
;;
@@ -111,7 +118,7 @@ move_all_to_init_class() {
stop() {
move_all_to_init_class
umount_fs
- rm -f /var/lock/cgconfig
+ rm -f /var/lock/subsys/$servicename
}
trapped() {
@@ -122,7 +129,7 @@ trapped() {
}
usage() {
- echo "$0 <start|stop>"
+ echo "$0 <start|stop|restart|condrestart|status>"
exit 1
}
@@ -157,6 +164,19 @@ case $1 in
stop
start
;;
+ 'condrestart')
+ if [ -f /var/lock/subsys/$servicename ] ; then
+ stop
+ start
+ fi
+ ;;
+ 'status')
+ if [ -f /var/lock/subsys/$servicename ] ; then
+ echo "Running"
+ else
+ echo "Stopped"
+ fi
+ ;;
*)
usage
;;
diff --git a/scripts/init.d/cgred b/scripts/init.d/cgred
index b99e769..3d9fe2a 100644
--- a/scripts/init.d/cgred
+++ b/scripts/init.d/cgred
@@ -23,7 +23,7 @@
#
### BEGIN INIT INFO
# Provides: cgrulesengd
-# Required-Start: $local_fs $syslog $wlm
+# Required-Start: $local_fs $syslog $cgconfig
# Required-Stop: $local_fs $syslog
# Should-Start:
# Should-Stop: