summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README_daemon2
-rw-r--r--libcgroup.spec.in8
-rw-r--r--samples/cgconfig.conf77
-rw-r--r--samples/cgred.conf2
-rw-r--r--scripts/init.d/cgred4
5 files changed, 46 insertions, 47 deletions
diff --git a/README_daemon b/README_daemon
index 1ff7a33..b19181c 100644
--- a/README_daemon
+++ b/README_daemon
@@ -54,7 +54,7 @@ was already started), and status (print whether the daemon is started or
stopped) commands are also supported. An additional command, "flash", allows
you to reload the configuration file without stopping the daemon.
/etc/init.d/cgred flash
-The cgred script automatically loads configuration from /etc/cgred.d/cgred.conf,
+The cgred script automatically loads configuration from /etc/sysconfig/cgred.conf,
which is shipped as samples/cgred.conf. See that file for more information.
If you choose not to run the daemon as a service, the following options are
diff --git a/libcgroup.spec.in b/libcgroup.spec.in
index 177c7c0..f96b784 100644
--- a/libcgroup.spec.in
+++ b/libcgroup.spec.in
@@ -40,7 +40,10 @@ make DESTDIR=$RPM_BUILD_ROOT install
mkdir -p $RPM_BUILD_ROOT/%{_initrddir}
cp scripts/init.d/cgconfig $RPM_BUILD_ROOT/%{_initrddir}/cgconfig
cp scripts/init.d/cgred $RPM_BUILD_ROOT/%{_initrddir}/cgred
-
+mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig
+cp samples/cgred.conf $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/cgred.conf
+cp samples/cgconfig.conf $RPM_BUILD_ROOT/%{_sysconfdir}/cgconfig.conf
+cp samples/cgrules.conf $RPM_BUILD_ROOT/%{_sysconfdir}/cgrules.conf
%clean
rm -rf $RPM_BUILD_ROOT
@@ -63,6 +66,9 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
+%config(noreplace) %{_sysconfdir}/sysconfig/cgred.conf
+%config(noreplace) %{_sysconfdir}/cgconfig.conf
+%config(noreplace) %{_sysconfdir}/cgrules.conf
%{_libdir}/libcgroup-%{version}.so
%{_libdir}/libcgroup.so.*
%{_bindir}/cgexec
diff --git a/samples/cgconfig.conf b/samples/cgconfig.conf
index 782f724..de77e4b 100644
--- a/samples/cgconfig.conf
+++ b/samples/cgconfig.conf
@@ -10,46 +10,39 @@
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
-# controller file
+#group daemons/www {
+# perm {
+# task {
+# uid = root;
+# gid = webmaster;
+# }
+# admin {
+# uid = root;
+# gid = root;
+# }
+# }
+# cpu {
+# cpu.shares = 1000;
+# }
+#}
#
-
-group ca1 {
- perm {
- task {
- uid = root;
- gid = root;
- }
- admin {
- uid = root;
- gid = root;
- }
- }
-
- cpu {
- cpu.shares = 500;
- }
-
-}
-
-group db {
- perm {
- task {
- uid = balbir;
- gid = balbir;
- }
- admin {
- uid = balbir;
- gid = balbir;
- }
- }
-
- cpu {
- cpu.shares = 500;
- }
-
-}
-
-mount {
- cpu = /tmp/cpu;
- cpuacct = /tmp/cpuacct;
-}
+#group daemons/ftp {
+# perm {
+# task {
+# uid = root;
+# gid = ftpmaster;
+# }
+# admin {
+# uid = root;
+# gid = root;
+# }
+# }
+# cpu {
+# cpu.shares = 500;
+# }
+#}
+#
+#mount {
+# cpu = /mnt/cgroups/cpu;
+# cpuacct = /mnt/cgroups/cpuacct;
+#}
diff --git a/samples/cgred.conf b/samples/cgred.conf
index 14209e5..6acbf79 100644
--- a/samples/cgred.conf
+++ b/samples/cgred.conf
@@ -1,4 +1,4 @@
-# /etc/cgred.d/cgred.conf - CGroup Rules Engine Daemon configuration file
+# /etc/sysconfig/cgred.conf - CGroup Rules Engine Daemon configuration file
#
# The four options listed below (CONFIG_FILE, LOG_FILE, NODAEMON, LOG) are
# the only valid ones. Defining anything else in this file will cause the
diff --git a/scripts/init.d/cgred b/scripts/init.d/cgred
index f0eebc4..bdd7979 100644
--- a/scripts/init.d/cgred
+++ b/scripts/init.d/cgred
@@ -48,8 +48,8 @@ CGRED_BIN=${exec_prefix}/${bindir}/cgrulesengd
. /lib/lsb/init-functions
# Read in configuration options.
-if [ -f "/etc/cgred.d/cgred.conf" ] ; then
- . /etc/cgred.d/cgred.conf
+if [ -f "/etc/sysconfig/cgred.conf" ] ; then
+ . /etc/sysconfig/cgred.conf
OPTIONS="$NODAEMON $LOG"
if [ -n "$LOG_FILE" ]; then
OPTIONS="$OPTIONS --log-file=$LOG_FILE"