summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Safranek <jsafrane@redhat.com>2009-04-14 13:52:47 +0200
committerDhaval Giani <dhaval@linux.vnet.ibm.com>2009-05-08 10:45:25 +0530
commit47045ddcf5e98fec52174fc075a7e61291aeaa75 (patch)
tree7df53b73b8db1e99ed74f7db182859f951cae06a
parent8624b3397ff6dbdbfd44dcd6efe8add0492e2d2d (diff)
downloadlibcg-47045ddcf5e98fec52174fc075a7e61291aeaa75.tar.gz
libcg-47045ddcf5e98fec52174fc075a7e61291aeaa75.tar.xz
libcg-47045ddcf5e98fec52174fc075a7e61291aeaa75.zip
Generate paths in initscripts by configure script
Change the hardcoded paths in initscripts to dynamically generated ones. The real executable path $bindir can be constructed using $prefix and $exec_prefix variables, therefore it's necessary to define also these two. The patch includes removal of old initscripts from git - they are generated from .in file now. I did not run autoreconf, I think the generated junk is being removed from git soon. Signed-off-by: Jan Safranek <jsafrane@redhat.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
-rw-r--r--configure.in2
-rw-r--r--scripts/Makefile.am2
-rw-r--r--scripts/init.d/cgconfig.in (renamed from scripts/init.d/cgconfig)6
-rw-r--r--scripts/init.d/cgred.in (renamed from scripts/init.d/cgred)7
4 files changed, 9 insertions, 8 deletions
diff --git a/configure.in b/configure.in
index cb54d15..8271cd1 100644
--- a/configure.in
+++ b/configure.in
@@ -76,6 +76,8 @@ AC_CONFIG_FILES([Makefile
src/tools/Makefile
src/pam/Makefile
scripts/Makefile
+ scripts/init.d/cgconfig
+ scripts/init.d/cgred
samples/Makefile
include/Makefile
doc/Makefile
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index b5270fb..0bc7938 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -1 +1 @@
-EXTRA_DIST = init.d/cgconfig init.d/cgred
+EXTRA_DIST = init.d/cgconfig.in init.d/cgred.in
diff --git a/scripts/init.d/cgconfig b/scripts/init.d/cgconfig.in
index 6b01d9c..543cb9f 100644
--- a/scripts/init.d/cgconfig
+++ b/scripts/init.d/cgconfig.in
@@ -29,7 +29,9 @@
# Description: This script allows us to create a default configuration
### END INIT INFO
-PATH=/bin:/usr/bin:/sbin:/usr/sbin:.
+# get correct location of binaries from configure
+prefix=@prefix@;exec_prefix=@exec_prefix@;sbindir=@sbindir@
+CGCONFIGPARSER_BIN=$sbindir/cgconfigparser
MOUNTS_FILE=/proc/mounts
PROC_CGROUPS_FILE=/proc/cgroups
CGROUP_FS=cgroup
@@ -78,7 +80,7 @@ start() {
if [ $? -eq 0 ]
then
- cgconfigparser -l $CONFIG_FILE
+ $CGCONFIGPARSER_BIN -l $CONFIG_FILE
retval=$?
if [ $retval -ne 0 ]
then
diff --git a/scripts/init.d/cgred b/scripts/init.d/cgred.in
index fa824df..f539fe7 100644
--- a/scripts/init.d/cgred
+++ b/scripts/init.d/cgred.in
@@ -32,11 +32,8 @@
# cgroups to classify processes
### END INIT INFO
-prefix=/usr
-exec_prefix=/usr
-bindir=/bin
-
-CGRED_BIN=${exec_prefix}/${bindir}/cgrulesengd
+prefix=@prefix@;exec_prefix=@exec_prefix@;bindir=@bindir@
+CGRED_BIN=$bindir/cgrulesengd
# Sanity checks
[ -x $CGRED_BIN ] || exit 1