chukwa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ey...@apache.org
Subject svn commit: r764133 - in /hadoop/chukwa/trunk: ./ bin/ tools/init.d/ tools/service/chukwa-agent/ tools/service/chukwa-collector/ tools/service/chukwa-df/ tools/service/chukwa-hdfsusage/ tools/service/chukwa-iostat/ tools/service/chukwa-netstat/ tools/s...
Date Sat, 11 Apr 2009 01:22:08 GMT
Author: eyang
Date: Sat Apr 11 01:22:07 2009
New Revision: 764133

URL: http://svn.apache.org/viewvc?rev=764133&view=rev
Log:
CHUKWA-80. Extracted rpm spec file from build.xml file.  Fix start up script, and config script.

Added:
    hadoop/chukwa/trunk/tools/specs/
    hadoop/chukwa/trunk/tools/specs/chukwa.spec
Modified:
    hadoop/chukwa/trunk/bin/chukwa-config.sh
    hadoop/chukwa/trunk/build.xml
    hadoop/chukwa/trunk/tools/init.d/chukwa-agent
    hadoop/chukwa/trunk/tools/init.d/chukwa-collector
    hadoop/chukwa/trunk/tools/init.d/chukwa-data-processors
    hadoop/chukwa/trunk/tools/init.d/chukwa-system-metrics
    hadoop/chukwa/trunk/tools/service/chukwa-agent/run
    hadoop/chukwa/trunk/tools/service/chukwa-collector/run
    hadoop/chukwa/trunk/tools/service/chukwa-df/run
    hadoop/chukwa/trunk/tools/service/chukwa-hdfsusage/run
    hadoop/chukwa/trunk/tools/service/chukwa-iostat/run
    hadoop/chukwa/trunk/tools/service/chukwa-netstat/run
    hadoop/chukwa/trunk/tools/service/chukwa-pbsnodes/run
    hadoop/chukwa/trunk/tools/service/chukwa-ps/run
    hadoop/chukwa/trunk/tools/service/chukwa-sar/run
    hadoop/chukwa/trunk/tools/service/chukwa-top/run
    hadoop/chukwa/trunk/tools/service/chukwa-torque/run

Modified: hadoop/chukwa/trunk/bin/chukwa-config.sh
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/bin/chukwa-config.sh?rev=764133&r1=764132&r2=764133&view=diff
==============================================================================
--- hadoop/chukwa/trunk/bin/chukwa-config.sh (original)
+++ hadoop/chukwa/trunk/bin/chukwa-config.sh Sat Apr 11 01:22:07 2009
@@ -96,7 +96,7 @@
 fi
 
 export DATACONFIG=${CHUKWA_CONF_DIR}/mdl.xml
-COMMON=`ls ${CHUKWA_HOME}/lib/*.jar ${CHUKWA_HOME}/hadoopjars/commons*.jar`
+COMMON=`ls ${CHUKWA_HOME}/lib/*.jar`
 export COMMON=`echo ${COMMON} | sed 'y/ /:/'`
 export CHUKWA_CORE=${CHUKWA_HOME}/chukwa-core-${CHUKWA_VERSION}.jar
 export CHUKWA_AGENT=${CHUKWA_HOME}/chukwa-agent-${CHUKWA_VERSION}.jar

Modified: hadoop/chukwa/trunk/build.xml
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/build.xml?rev=764133&r1=764132&r2=764133&view=diff
==============================================================================
--- hadoop/chukwa/trunk/build.xml (original)
+++ hadoop/chukwa/trunk/build.xml Sat Apr 11 01:22:07 2009
@@ -818,118 +818,20 @@
 			        <include name="${final.name}.tar.gz" />
                         </fileset>
                 </copy>
-                <echo file="${build.dir}/SPECS/chukwa.spec" append="false">
-# RPM Spec file for Chukwa v.${chukwaVersion}
-
-%define _topdir         ${build.dir}
-%define _prefix         ${rpm.prefix}
-%define uid             ${rpm.uid}
-%define gid             ${rpm.gid}
-%define name            chukwa
-%define summary         Distributed Computing Monitoring Framework.
-%define version         ${chukwaVersion}
-%define release         ${chukwaRelease}
-%define license         ASF 2.0
-%define group           Development/Monitoring
-%define source          %{name}-%{version}.tar.gz
-%define vendor          Apache Software Fundation
-%define packager        Eric Yang
-%define buildroot       %{_topdir}/BUILD
-
-Name:      %{name}
-Version:   %{version}
-Release:   %{release}
-Packager:  %{packager}
-Vendor:    %{vendor}
-License:   %{license}
-Summary:   %{summary}
-Group:     %{group}
-Source0:   %{source}
-Prefix:    %{_prefix}
-Buildroot: %{buildroot}
-
-%description
-Chukwa is the monitoring framework for large scale distributed
-clusters.
-
-%prep
-%setup -q
-%build
-mkdir -p %{buildroot}%{_prefix}
-if [ -d %{buildroot}%{_prefix} ]; then
-    rm -rf %{buildroot}%{_prefix}
-fi
-mv %{buildroot}/%{name}-%{version} %{buildroot}%{_prefix}
-cd %{buildroot}%{_prefix}
-mkdir -p %{buildroot}/etc/init.d
-mkdir -p %{buildroot}/service/chukwa-agent
-mkdir -p %{buildroot}/service/chukwa-collector
-mkdir -p %{buildroot}/service/chukwa-df
-mkdir -p %{buildroot}/service/chukwa-iostat
-mkdir -p %{buildroot}/service/chukwa-netstat
-mkdir -p %{buildroot}/service/chukwa-pbsnodes
-mkdir -p %{buildroot}/service/chukwa-sar
-mkdir -p %{buildroot}/service/chukwa-top
-mkdir -p %{buildroot}/service/chukwa-ps
-mkdir -p %{buildroot}/service/chukwa-torque
-cat %{buildroot}%{_prefix}/tools/init.d/chukwa-data-processors | \
-sed 's:- chukwa -c:- %{uid} -c:' | \
-sed 's:CHUKWA_HOME=/usr/local:CHUKWA_HOME=%{_prefix}:' | \
-sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' > %{buildroot}/etc/init.d/chukwa-data-processors
-cat %{buildroot}%{_prefix}/tools/init.d/chukwa-collector | \
-sed 's:- chukwa -c:- %{uid} -c:' | \
-sed 's:CHUKWA_HOME=/usr/local:CHUKWA_HOME=%{_prefix}:' | \
-sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' > %{buildroot}/etc/init.d/chukwa-collector
-cat %{buildroot}%{_prefix}/tools/service/chukwa-agent/run | sed 's:/usr/local/chukwa:%{_prefix}:'
| \
-sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' > %{buildroot}/service/chukwa-agent/run
-cat %{buildroot}%{_prefix}/tools/service/chukwa-df/run | sed 's:/usr/local/chukwa:%{_prefix}:'
| \
-sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' > %{buildroot}/service/chukwa-df/run
-cat %{buildroot}%{_prefix}/tools/service/chukwa-iostat/run | sed 's:/usr/local/chukwa:%{_prefix}:'
| \
-sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' > %{buildroot}/service/chukwa-iostat/run
-cat %{buildroot}%{_prefix}/tools/service/chukwa-netstat/run | sed 's:/usr/local/chukwa:%{_prefix}:'
| \
-sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' > %{buildroot}/service/chukwa-netstat/run
-cat %{buildroot}%{_prefix}/tools/service/chukwa-sar/run | sed 's:/usr/local/chukwa:%{_prefix}:'
| \
-sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' > %{buildroot}/service/chukwa-sar/run
-cat %{buildroot}%{_prefix}/tools/service/chukwa-top/run | sed 's:/usr/local/chukwa:%{_prefix}:'
| \
-sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' > %{buildroot}/service/chukwa-top/run
-cat %{buildroot}%{_prefix}/tools/service/chukwa-ps/run | sed 's:/usr/local/chukwa:%{_prefix}:'
| \
-sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' > %{buildroot}/service/chukwa-ps/run
-#cat %{buildroot}%{_prefix}/tools/service/chukwa-collector/run | sed 's:/usr/local/chukwa:%{_prefix}:'
| \
-#sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' > %{buildroot}/service/chukwa-collector/run
-#cat %{buildroot}%{_prefix}/tools/service/chukwa-pbsnodes/run | sed 's:/usr/local/chukwa:%{_prefix}:'
| \
-#sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' > %{buildroot}/service/chukwa-pbsnodes/run
-#cat %{buildroot}%{_prefix}/tools/service/chukwa-torque/run | sed 's:/usr/local/chukwa:%{_prefix}:'
| \
-#sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' > %{buildroot}/service/chukwa-torque/run
-cat %{buildroot}%{_prefix}/tools/service/chukwa-hdfsusage/run | \
-sed 's:/usr/local/chukwa:%{_prefix}:' > %{buildroot}%{_prefix}/tools/service/chukwa-hdfsusage/run.new
-mv %{buildroot}%{_prefix}/tools/service/chukwa-hdfsusage/run.new %{buildroot}%{_prefix}/tools/service/chukwa-hdfsusage/run
-chmod a+x %{buildroot}%{_prefix}/tools/expire.sh
-chmod a+x %{buildroot}/etc/init.d/chukwa-*
-chmod -R a+x %{buildroot}%{_prefix}/tools/service/chukwa-*
-chmod -R a+x %{buildroot}/service/chukwa-*
-rm -rf %{buildroot}%{_prefix}/src
-rm -rf %{buildroot}%{_prefix}/build.xml
-%post
-mkdir -p %{_prefix}
-echo "Congratulation!  You have successfully installed Chukwa."
-%preun
-echo
-%postun
-%files
-%defattr(-,%{uid},%{gid})
-%{_prefix}
-%{_prefix}/*
-%defattr(-,root,root)
-/etc/init.d/chukwa-data-processors
-/etc/init.d/chukwa-collector
-/service/chukwa-agent/run
-/service/chukwa-df/run
-/service/chukwa-iostat/run
-/service/chukwa-netstat/run
-/service/chukwa-sar/run
-/service/chukwa-top/run
-/service/chukwa-ps/run
-                </echo>
+                <copy file="${basedir}/tools/specs/chukwa.spec"
+                            tofile="${build.dir}/SPECS/chukwa.spec" >
+                        <filterchain>
+                                <replacetokens>
+                                        <token key="chukwaVersion" value="${chukwaVersion}"/>
+                                        <token key="chukwaRelease" value="${chukwaRelease}"/>
+                                        <token key="build.dir" value="${build.dir}"/>
+                                        <token key="rpm.prefix" value="${rpm.prefix}"/>
+                                        <token key="rpm.conf.dir" value="${rpm.conf.dir}"/>
+                                        <token key="rpm.uid" value="${rpm.uid}"/>
+                                        <token key="rpm.gid" value="${rpm.gid}"/>
+                                </replacetokens>
+                        </filterchain>
+                </copy>
 		<rpm specFile="chukwa.spec" topDir="${build.dir}" cleanBuildDir="true" failOnError="true"/>
         </target>
 

Modified: hadoop/chukwa/trunk/tools/init.d/chukwa-agent
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/tools/init.d/chukwa-agent?rev=764133&r1=764132&r2=764133&view=diff
==============================================================================
--- hadoop/chukwa/trunk/tools/init.d/chukwa-agent (original)
+++ hadoop/chukwa/trunk/tools/init.d/chukwa-agent Sat Apr 11 01:22:07 2009
@@ -33,13 +33,14 @@
 config () {
         CHUKWA_HOME=/usr/local/chukwa
         CHUKWA_CONF_DIR=/usr/local/chukwa/conf
+        CHUKWA_USER=chukwa
 }
 
 start () {
         echo -n $"Starting $prog: "
         config
         # start daemon
-	su - chukwa -c "${CHUKWA_HOME}/bin/chukwa-daemon.sh --config=${CHUKWA_CONF_DIR} --watchdog
start agent.sh"
+	su - ${CHUKWA_USER} -c "${CHUKWA_HOME}/bin/chukwa-daemon.sh --config=${CHUKWA_CONF_DIR}
--watchdog start agent.sh"
         RETVAL=$?
         echo
         [ $RETVAL = 0 ] && touch /var/lock/subsys/$prog
@@ -50,7 +51,7 @@
         # stop daemon
         echo -n $"Stopping $prog: "
         config
-	su - chukwa -c "${CHUKWA_HOME}/bin/chukwa-daemon.sh --config=${CHUKWA_CONF_DIR} --watchdog
stop agent.sh"
+	su - ${CHUKWA_USER} -c "${CHUKWA_HOME}/bin/chukwa-daemon.sh --config=${CHUKWA_CONF_DIR}
--watchdog stop agent.sh"
         RETVAL=$?
         echo
         [ $RETVAL = 0 ] && rm -f /var/lock/subsys/$prog

Modified: hadoop/chukwa/trunk/tools/init.d/chukwa-collector
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/tools/init.d/chukwa-collector?rev=764133&r1=764132&r2=764133&view=diff
==============================================================================
--- hadoop/chukwa/trunk/tools/init.d/chukwa-collector (original)
+++ hadoop/chukwa/trunk/tools/init.d/chukwa-collector Sat Apr 11 01:22:07 2009
@@ -39,7 +39,7 @@
         echo -n $"Starting $prog: "
         config
         # start daemon
-	su - chukwa -c "${CHUKWA_HOME}/bin/chukwa-daemon.sh  --config=${CHUKWA_CONF_DIR} --watchdog
start jettyCollector.sh"
+	su - chukwa -c "${CHUKWA_HOME}/bin/chukwa-daemon.sh  --config ${CHUKWA_CONF_DIR} --watchdog
start jettyCollector.sh"
         RETVAL=$?
         echo
         [ $RETVAL = 0 ] && touch /var/lock/subsys/$prog
@@ -50,7 +50,7 @@
         # stop daemon
         config
         echo -n $"Stopping $prog: "
-	su - chukwa -c "${CHUKWA_HOME}/bin/chukwa-daemon.sh  --config=${CHUKWA_CONF_DIR} --watchdog
stop jettyCollector.sh"
+	su - chukwa -c "${CHUKWA_HOME}/bin/chukwa-daemon.sh  --config ${CHUKWA_CONF_DIR} --watchdog
stop jettyCollector.sh"
         RETVAL=$?
         echo
         [ $RETVAL = 0 ] && rm -f /var/lock/subsys/$prog

Modified: hadoop/chukwa/trunk/tools/init.d/chukwa-data-processors
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/tools/init.d/chukwa-data-processors?rev=764133&r1=764132&r2=764133&view=diff
==============================================================================
--- hadoop/chukwa/trunk/tools/init.d/chukwa-data-processors (original)
+++ hadoop/chukwa/trunk/tools/init.d/chukwa-data-processors Sat Apr 11 01:22:07 2009
@@ -31,13 +31,14 @@
 config () {
         CHUKWA_HOME=/usr/local/chukwa
         CHUKWA_CONF_DIR=/usr/local/chukwa/conf
+        CHUKWA_USER=chukwa
 }
 
 start () {
         echo -n $"Starting $prog: "
         config
         # start daemon
-	su - chukwa -c "${CHUKWA_HOME}/bin/start-data-processors.sh --config $CHUKWA_CONF_DIR "
+	su - ${CHUKWA_USER} -c "${CHUKWA_HOME}/bin/start-data-processors.sh --config $CHUKWA_CONF_DIR
"
         RETVAL=$?
         echo
         [ $RETVAL = 0 ] && touch /var/lock/subsys/$prog
@@ -48,7 +49,7 @@
         # stop daemon
         echo -n $"Stopping $prog: "
         config
-	su - chukwa -c "${CHUKWA_HOME}/bin/stop-data-processors.sh --config $CHUKWA_CONF_DIR "
+	su - ${CHUKWA_USER} -c "${CHUKWA_HOME}/bin/stop-data-processors.sh --config $CHUKWA_CONF_DIR
"
         RETVAL=$?
         echo
         [ $RETVAL = 0 ] && rm -f /var/lock/subsys/$prog

Modified: hadoop/chukwa/trunk/tools/init.d/chukwa-system-metrics
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/tools/init.d/chukwa-system-metrics?rev=764133&r1=764132&r2=764133&view=diff
==============================================================================
--- hadoop/chukwa/trunk/tools/init.d/chukwa-system-metrics (original)
+++ hadoop/chukwa/trunk/tools/init.d/chukwa-system-metrics Sat Apr 11 01:22:07 2009
@@ -26,6 +26,7 @@
         exit 0
 fi
 
+CHUKWA_USER=chukwa
 DAEMON=systemDataLoader.sh
 
 prog=chukwa-system-metrics
@@ -39,7 +40,7 @@
         echo -n $"Starting $prog: "
         config
         # start daemon
-	su - chukwa -c "${CHUKWA_HOME}/bin/chukwa-daemon.sh --config=${CHUKWA_CONF_DIR} start systemDataLoader.sh"
+	su - ${CHUKWA_USER} -c "${CHUKWA_HOME}/bin/chukwa-daemon.sh --config ${CHUKWA_CONF_DIR}
start systemDataLoader.sh"
         RETVAL=$?
         echo
         [ $RETVAL = 0 ] && touch /var/lock/subsys/$prog
@@ -50,7 +51,7 @@
         # stop daemon
         echo -n $"Stopping $prog: "
         config
-	su - chukwa -c "${CHUKWA_HOME}/bin/chukwa-daemon.sh  --config=${CHUKWA_CONF_DIR} stop systemDataLoader.sh"
+	su - ${CHUKWA_USER} -c "${CHUKWA_HOME}/bin/chukwa-daemon.sh  --config ${CHUKWA_CONF_DIR}
stop systemDataLoader.sh"
         RETVAL=$?
         echo
         [ $RETVAL = 0 ] && rm -f /var/lock/subsys/$prog

Modified: hadoop/chukwa/trunk/tools/service/chukwa-agent/run
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/tools/service/chukwa-agent/run?rev=764133&r1=764132&r2=764133&view=diff
==============================================================================
--- hadoop/chukwa/trunk/tools/service/chukwa-agent/run (original)
+++ hadoop/chukwa/trunk/tools/service/chukwa-agent/run Sat Apr 11 01:22:07 2009
@@ -1,5 +1,6 @@
 #!/bin/sh
 CHUKWA_CONF_DIR=/usr/local/chukwa/conf
-
-exec setuidgid gmon /usr/local/chukwa/bin/agent.sh --config $CHUKWA_CONF_DIR &>/dev/null
+CHUKWA_HOME=/usr/local/chukwa
+CHUKWA_USER=chukwa
+exec setuidgid ${CHUKWA_USER} ${CHUKWA_HOME}/bin/agent.sh --config $CHUKWA_CONF_DIR &>/dev/null
 

Modified: hadoop/chukwa/trunk/tools/service/chukwa-collector/run
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/tools/service/chukwa-collector/run?rev=764133&r1=764132&r2=764133&view=diff
==============================================================================
--- hadoop/chukwa/trunk/tools/service/chukwa-collector/run (original)
+++ hadoop/chukwa/trunk/tools/service/chukwa-collector/run Sat Apr 11 01:22:07 2009
@@ -1,5 +1,6 @@
 #!/bin/sh
 CHUKWA_CONF_DIR=/usr/local/chukwa/conf
-
-exec setuidgid gmon /usr/local/chukwa/bin/jettyCollector.sh --config $CHUKWA_CONF_DIR &>/dev/null
+CHUKWA_HOME_DIR=/usr/local/chukwa
+CHUKWA_USER=chukwa
+exec setuidgid ${CHUKWA_USER} ${CHUKWA_HOME_DIR}/bin/jettyCollector.sh --config $CHUKWA_CONF_DIR
&>/dev/null
 

Modified: hadoop/chukwa/trunk/tools/service/chukwa-df/run
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/tools/service/chukwa-df/run?rev=764133&r1=764132&r2=764133&view=diff
==============================================================================
--- hadoop/chukwa/trunk/tools/service/chukwa-df/run (original)
+++ hadoop/chukwa/trunk/tools/service/chukwa-df/run Sat Apr 11 01:22:07 2009
@@ -1,5 +1,7 @@
 #!/bin/sh
 CHUKWA_CONF_DIR=/usr/local/chukwa/conf
+CHUKWA_HOME=/usr/local/chukwa
+CHUKWA_USER=chukwa
 
-exec setuidgid gmon /usr/local/chukwa/bin/exec-data-loader.sh --config $CHUKWA_CONF_DIR df
&>/dev/null
+exec setuidgid ${CHUKWA_USER} ${CHUKWA_HOME}/bin/exec-data-loader.sh --config $CHUKWA_CONF_DIR
df &>/dev/null
 

Modified: hadoop/chukwa/trunk/tools/service/chukwa-hdfsusage/run
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/tools/service/chukwa-hdfsusage/run?rev=764133&r1=764132&r2=764133&view=diff
==============================================================================
--- hadoop/chukwa/trunk/tools/service/chukwa-hdfsusage/run (original)
+++ hadoop/chukwa/trunk/tools/service/chukwa-hdfsusage/run Sat Apr 11 01:22:07 2009
@@ -1,5 +1,7 @@
 #!/bin/sh
 CHUKWA_CONF_DIR=/usr/local/chukwa/conf
+CHUKWA_HOME=/usr/local/chukwa
+CHUKWA_USER=chukwa
 
-exec setuidgid gmon /usr/local/chukwa/bin/exec-data-loader.sh --config $CHUKWA_CONF_DIR HDFSUsage
&>/dev/null
+exec setuidgid ${CHUKWA_USER} ${CHUKWA_HOME}/bin/exec-data-loader.sh --config $CHUKWA_CONF_DIR
HDFSUsage &>/dev/null
 

Modified: hadoop/chukwa/trunk/tools/service/chukwa-iostat/run
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/tools/service/chukwa-iostat/run?rev=764133&r1=764132&r2=764133&view=diff
==============================================================================
--- hadoop/chukwa/trunk/tools/service/chukwa-iostat/run (original)
+++ hadoop/chukwa/trunk/tools/service/chukwa-iostat/run Sat Apr 11 01:22:07 2009
@@ -1,5 +1,6 @@
 #!/bin/sh
 CHUKWA_CONF_DIR=/usr/local/chukwa/conf
-
-exec setuidgid gmon /usr/local/chukwa/bin/exec-data-loader.sh --config $CHUKWA_CONF_DIR iostat
&>/dev/null
+CHUKWA_HOME=/usr/local/chukwa
+CHUKWA_USER=chukwa
+exec setuidgid ${CHUKWA_USER} ${CHUKWA_HOME}/bin/exec-data-loader.sh --config $CHUKWA_CONF_DIR
iostat &>/dev/null
 

Modified: hadoop/chukwa/trunk/tools/service/chukwa-netstat/run
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/tools/service/chukwa-netstat/run?rev=764133&r1=764132&r2=764133&view=diff
==============================================================================
--- hadoop/chukwa/trunk/tools/service/chukwa-netstat/run (original)
+++ hadoop/chukwa/trunk/tools/service/chukwa-netstat/run Sat Apr 11 01:22:07 2009
@@ -1,5 +1,6 @@
 #!/bin/sh
 CHUKWA_CONF_DIR=/usr/local/chukwa/conf
-
-exec setuidgid gmon /usr/local/chukwa/bin/exec-data-loader.sh --config $CHUKWA_CONF_DIR netstat
&>/dev/null
+CHUKWA_HOME=/usr/local/chukwa
+CHUKWA_USER=chukwa
+exec setuidgid ${CHUKWA_USER} ${CHUKWA_HOME}/bin/exec-data-loader.sh --config $CHUKWA_CONF_DIR
netstat &>/dev/null
 

Modified: hadoop/chukwa/trunk/tools/service/chukwa-pbsnodes/run
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/tools/service/chukwa-pbsnodes/run?rev=764133&r1=764132&r2=764133&view=diff
==============================================================================
--- hadoop/chukwa/trunk/tools/service/chukwa-pbsnodes/run (original)
+++ hadoop/chukwa/trunk/tools/service/chukwa-pbsnodes/run Sat Apr 11 01:22:07 2009
@@ -1,5 +1,6 @@
 #!/bin/sh
 CHUKWA_CONF_DIR=/usr/local/chukwa/conf
-
-exec setuidgid gmon /usr/local/chukwa/bin/exec-data-loader.sh --config $CHUKWA_CONF_DIR pbsnodes
&>/dev/null
+CHUKWA_HOME=/usr/local/chukwa
+CHUKWA_USER=chukwa
+exec setuidgid ${CHUKWA_USER} ${CHUKWA_HOME}/bin/exec-data-loader.sh --config $CHUKWA_CONF_DIR
pbsnodes &>/dev/null
 

Modified: hadoop/chukwa/trunk/tools/service/chukwa-ps/run
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/tools/service/chukwa-ps/run?rev=764133&r1=764132&r2=764133&view=diff
==============================================================================
--- hadoop/chukwa/trunk/tools/service/chukwa-ps/run (original)
+++ hadoop/chukwa/trunk/tools/service/chukwa-ps/run Sat Apr 11 01:22:07 2009
@@ -1,5 +1,6 @@
 #!/bin/sh
 CHUKWA_CONF_DIR=/usr/local/chukwa/conf
-
-exec setuidgid gmon /usr/local/chukwa/bin/exec-data-loader.sh --config $CHUKWA_CONF_DIR ps
+CHUKWA_HOME=/usr/local/chukwa
+CHUKWA_USER=chukwa
+exec setuidgid ${CHUKWA_USER} ${CHUKWA_HOME}/bin/exec-data-loader.sh --config $CHUKWA_CONF_DIR
ps
 

Modified: hadoop/chukwa/trunk/tools/service/chukwa-sar/run
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/tools/service/chukwa-sar/run?rev=764133&r1=764132&r2=764133&view=diff
==============================================================================
--- hadoop/chukwa/trunk/tools/service/chukwa-sar/run (original)
+++ hadoop/chukwa/trunk/tools/service/chukwa-sar/run Sat Apr 11 01:22:07 2009
@@ -1,4 +1,5 @@
 #!/bin/sh
 CHUKWA_CONF_DIR=/usr/local/chukwa/conf
-
-exec setuidgid gmon /usr/local/chukwa/bin/exec-data-loader.sh --config $CHUKWA_CONF_DIR sar
&>/dev/null
+CHUKWA_HOME=/usr/local/chukwa
+CHUKWA_USER=chukwa
+exec setuidgid ${CHUKWA_USER} ${CHUKWA_HOME}/bin/exec-data-loader.sh --config $CHUKWA_CONF_DIR
sar &>/dev/null

Modified: hadoop/chukwa/trunk/tools/service/chukwa-top/run
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/tools/service/chukwa-top/run?rev=764133&r1=764132&r2=764133&view=diff
==============================================================================
--- hadoop/chukwa/trunk/tools/service/chukwa-top/run (original)
+++ hadoop/chukwa/trunk/tools/service/chukwa-top/run Sat Apr 11 01:22:07 2009
@@ -1,5 +1,6 @@
 #!/bin/sh
 CHUKWA_CONF_DIR=/usr/local/chukwa/conf
-
-exec setuidgid gmon /usr/local/chukwa/bin/exec-data-loader.sh --config $CHUKWA_CONF_DIR top
&>/dev/null
+CHUKWA_HOME=/usr/local/chukwa
+CHUKWA_USER=chukwa
+exec setuidgid ${CHUKWA_USER} ${CHUKWA_HOME}/bin/exec-data-loader.sh --config $CHUKWA_CONF_DIR
top &>/dev/null
 

Modified: hadoop/chukwa/trunk/tools/service/chukwa-torque/run
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/tools/service/chukwa-torque/run?rev=764133&r1=764132&r2=764133&view=diff
==============================================================================
--- hadoop/chukwa/trunk/tools/service/chukwa-torque/run (original)
+++ hadoop/chukwa/trunk/tools/service/chukwa-torque/run Sat Apr 11 01:22:07 2009
@@ -1,5 +1,6 @@
 #!/bin/sh
 CHUKWA_CONF_DIR=/usr/local/chukwa/conf
-
-exec setuidgid gmon /usr/local/chukwa/bin/exec-data-loader.sh --config $CHUKWA_CONF_DIR torque
&>/dev/null
+CHUKWA_HOME=/usr/local/chukwa
+CHUKWA_USER=chukwa
+exec setuidgid ${CHUKWA_USER} ${CHUKWA_HOME}/bin/exec-data-loader.sh --config $CHUKWA_CONF_DIR
torque &>/dev/null
 

Added: hadoop/chukwa/trunk/tools/specs/chukwa.spec
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/tools/specs/chukwa.spec?rev=764133&view=auto
==============================================================================
--- hadoop/chukwa/trunk/tools/specs/chukwa.spec (added)
+++ hadoop/chukwa/trunk/tools/specs/chukwa.spec Sat Apr 11 01:22:07 2009
@@ -0,0 +1,412 @@
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements.  See the NOTICE file distributed with
+#   this work for additional information regarding copyright ownership.
+#   The ASF licenses this file to You under the Apache License, Version 2.0
+#   (the "License"); you may not use this file except in compliance with
+#   the License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+# RPM Spec file for Chukwa v.@chukwaVersion@
+
+%define _topdir         @build.dir@
+%define _prefix         @rpm.prefix@
+%define _conf_dir       @rpm.conf.dir@
+%define uid             @rpm.uid@
+%define gid             @rpm.gid@
+%define name            chukwa
+%define summary         Distributed Computing Monitoring Framework.
+%define version         @chukwaVersion@
+%define release         @chukwaRelease@
+%define license         ASF 2.0
+%define group           Development/Monitoring
+%define source          %{name}-%{version}.tar.gz
+%define vendor          Apache Software Fundation
+%define packager        Hadoop Chukwa Team
+%define buildroot       %{_topdir}/BUILD
+
+Name:      %{name}
+Version:   %{version}
+Release:   %{release}
+Packager:  %{packager}
+Vendor:    %{vendor}
+License:   %{license}
+Summary:   %{summary}
+Group:     %{group}
+Source0:   %{source}
+Prefix:    %{_prefix}
+Buildroot: %{buildroot}
+
+%description
+Chukwa is the monitoring framework for large scale distributed
+clusters.
+
+%prep
+%setup -q
+%build
+mkdir -p %{buildroot}%{_prefix}
+if [ -d %{buildroot}%{_prefix} ]; then
+    rm -rf %{buildroot}%{_prefix}
+fi
+mv %{buildroot}/%{name}-%{version} %{buildroot}%{_prefix}
+cd %{buildroot}%{_prefix}
+mkdir -p %{buildroot}/etc/init.d
+
+cat %{buildroot}%{_prefix}/tools/init.d/chukwa-data-processors | \
+sed 's:CHUKWA_USER=chukwa:CHUKWA_USER=%{uid}:' | \
+sed 's:CHUKWA_HOME=/usr/local/chukwa:CHUKWA_HOME=%{_prefix}:' | \
+sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' > %{buildroot}/etc/init.d/chukwa-data-processors
+
+cat %{buildroot}%{_prefix}/tools/init.d/chukwa-collector | \
+sed 's:CHUKWA_USER=chukwa:CHUKWA_USER=%{uid}:' | \
+sed 's:CHUKWA_HOME=/usr/local/chukwa:CHUKWA_HOME=%{_prefix}:' | \
+sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' > %{buildroot}/etc/init.d/chukwa-collector
+
+cat %{buildroot}%{_prefix}/tools/service/chukwa-agent/run | \
+sed 's:CHUKWA_USER=chukwa:CHUKWA_USER=%{uid}:' | \
+sed 's:CHUKWA_HOME=/usr/local/chukwa:CHUKWA_HOME=%{_prefix}:' | \
+sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' \
+> %{buildroot}%{_prefix}/tools/service/chukwa-agent/run.new
+mv %{buildroot}%{_prefix}/tools/service/chukwa-agent/run.new %{buildroot}%{_prefix}/tools/service/chukwa-agent/run
+
+cat %{buildroot}%{_prefix}/tools/service/chukwa-df/run | \
+sed 's:CHUKWA_USER=chukwa:CHUKWA_USER=%{uid}:' | \
+sed 's:CHUKWA_HOME=/usr/local/chukwa:CHUKWA_HOME=%{_prefix}:' | \
+sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' \
+> %{buildroot}%{_prefix}/tools/service/chukwa-df/run.new
+mv %{buildroot}%{_prefix}/tools/service/chukwa-df/run.new %{buildroot}%{_prefix}/tools/service/chukwa-df/run
+
+cat %{buildroot}%{_prefix}/tools/service/chukwa-iostat/run | \
+sed 's:CHUKWA_USER=chukwa:CHUKWA_USER=%{uid}:' | \
+sed 's:CHUKWA_HOME=/usr/local/chukwa:CHUKWA_HOME=%{_prefix}:' | \
+sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' \
+> %{buildroot}%{_prefix}/tools/service/chukwa-iostat/run.new
+mv %{buildroot}%{_prefix}/tools/service/chukwa-iostat/run.new %{buildroot}%{_prefix}/tools/service/chukwa-iostat/run
+
+cat %{buildroot}%{_prefix}/tools/service/chukwa-netstat/run | \
+sed 's:CHUKWA_USER=chukwa:CHUKWA_USER=%{uid}:' | \
+sed 's:CHUKWA_HOME=/usr/local/chukwa:CHUKWA_HOME=%{_prefix}:' | \
+sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' \
+> %{buildroot}%{_prefix}/tools/service/chukwa-netstat/run.new
+mv %{buildroot}%{_prefix}/tools/service/chukwa-netstat/run.new %{buildroot}%{_prefix}/tools/service/chukwa-netstat/run
+
+cat %{buildroot}%{_prefix}/tools/service/chukwa-sar/run | \
+sed 's:CHUKWA_USER=chukwa:CHUKWA_USER=%{uid}:' | \
+sed 's:CHUKWA_HOME=/usr/local/chukwa:CHUKWA_HOME=%{_prefix}:' | \
+sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' \
+> %{buildroot}%{_prefix}/tools/service/chukwa-sar/run.new
+mv %{buildroot}%{_prefix}/tools/service/chukwa-sar/run.new %{buildroot}%{_prefix}/tools/service/chukwa-sar/run
+
+cat %{buildroot}%{_prefix}/tools/service/chukwa-top/run | \
+sed 's:CHUKWA_USER=chukwa:CHUKWA_USER=%{uid}:' | \
+sed 's:CHUKWA_HOME=/usr/local/chukwa:CHUKWA_HOME=%{_prefix}:' | \
+sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' \
+> %{buildroot}%{_prefix}/tools/service/chukwa-top/run.new
+mv %{buildroot}%{_prefix}/tools/service/chukwa-top/run.new %{buildroot}%{_prefix}/tools/service/chukwa-top/run
+
+cat %{buildroot}%{_prefix}/tools/service/chukwa-ps/run | \
+sed 's:CHUKWA_USER=chukwa:CHUKWA_USER=%{uid}:' | \
+sed 's:CHUKWA_HOME=/usr/local/chukwa:CHUKWA_HOME=%{_prefix}:' | \
+sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' \
+> %{buildroot}%{_prefix}/tools/service/chukwa-ps/run.new
+mv %{buildroot}%{_prefix}/tools/service/chukwa-ps/run.new %{buildroot}%{_prefix}/tools/service/chukwa-ps/run
+
+cat %{buildroot}%{_prefix}/tools/service/chukwa-collector/run | \
+sed 's:CHUKWA_USER=chukwa:CHUKWA_USER=%{uid}:' | \
+sed 's:CHUKWA_HOME=/usr/local/chukwa:CHUKWA_HOME=%{_prefix}:' | \
+sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' \
+> %{buildroot}%{_prefix}/tools/service/chukwa-collector/run.new
+mv %{buildroot}%{_prefix}/tools/service/chukwa-collector/run.new %{buildroot}%{_prefix}/tools/service/chukwa-collector/run
+
+cat %{buildroot}%{_prefix}/tools/service/chukwa-pbsnodes/run | \
+sed 's:CHUKWA_USER=chukwa:CHUKWA_USER=%{uid}:' | \
+sed 's:CHUKWA_HOME=/usr/local/chukwa:CHUKWA_HOME=%{_prefix}:' | \
+sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' \
+> %{buildroot}%{_prefix}/tools/service/chukwa-pbsnodes/run.new
+mv %{buildroot}%{_prefix}/tools/service/chukwa-pbsnodes/run.new %{buildroot}%{_prefix}/tools/service/chukwa-pbsnodes/run
+
+cat %{buildroot}%{_prefix}/tools/service/chukwa-torque/run | \
+sed 's:CHUKWA_USER=chukwa:CHUKWA_USER=%{uid}:' | \
+sed 's:CHUKWA_HOME=/usr/local/chukwa:CHUKWA_HOME=%{_prefix}:' | \
+sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' \
+> %{buildroot}%{_prefix}/tools/service/chukwa-torque/run.new
+mv %{buildroot}%{_prefix}/tools/service/chukwa-torque/run.new %{buildroot}%{_prefix}/tools/service/chukwa-torque/run
+
+cat %{buildroot}%{_prefix}/tools/service/chukwa-hdfsusage/run | \
+sed 's:CHUKWA_USER=chukwa:CHUKWA_USER=%{uid}:' | \
+sed 's:CHUKWA_HOME=/usr/local/chukwa:CHUKWA_HOME=%{_prefix}:' | \
+sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' \
+> %{buildroot}%{_prefix}/tools/service/chukwa-hdfsusage/run.new
+mv %{buildroot}%{_prefix}/tools/service/chukwa-hdfsusage/run.new %{buildroot}%{_prefix}/tools/service/chukwa-hdfsusage/run
+
+chmod a+x %{buildroot}%{_prefix}/tools/expire.sh
+chmod a+x %{buildroot}/etc/init.d/chukwa-*
+chmod -R a+x %{buildroot}%{_prefix}/tools/service/chukwa-*
+rm -rf %{buildroot}%{_prefix}/src
+rm -rf %{buildroot}%{_prefix}/build.xml
+%post
+if [ -d /service/chukwa-agent ]; then
+  if [ ! -L /service/chukwa-agent ]; then
+    rm -rf /service/chukwa-agent
+  fi
+fi
+if [ -d /service/chukwa-df ]; then
+  if [ ! -L /service/chukwa-df ]; then
+    rm -rf /service/chukwa-df
+  fi
+fi
+if [ -d /service/chukwa-iostat ]; then
+  if [ ! -L /service/chukwa-iostat ]; then
+    rm -rf /service/chukwa-iostat
+  fi
+fi
+if [ -d /service/chukwa-netstat ]; then
+  if [ ! -L /service/chukwa-netstat ]; then
+    rm -rf /service/chukwa-netstat
+  fi
+fi
+if [ -d /service/chukwa-ps ]; then
+  if [ ! -L /service/chukwa-ps ]; then
+    rm -rf /service/chukwa-ps
+  fi
+fi
+if [ -d /service/chukwa-sar ]; then
+  if [ ! -L /service/chukwa-sar ]; then
+    rm -rf /service/chukwa-sar
+  fi
+fi
+if [ -d /service/chukwa-top ]; then
+  if [ ! -L /service/chukwa-top ]; then
+    rm -rf /service/chukwa-top
+  fi
+fi
+mkdir -p %{_prefix}
+ln -sf %{_prefix}/tools/service/chukwa-agent /service/chukwa-agent
+ln -sf %{_prefix}/tools/service/chukwa-df /service/chukwa-df
+ln -sf %{_prefix}/tools/service/chukwa-iostat /service/chukwa-iostat
+ln -sf %{_prefix}/tools/service/chukwa-netstat /service/chukwa-netstat
+ln -sf %{_prefix}/tools/service/chukwa-sar /service/chukwa-sar
+ln -sf %{_prefix}/tools/service/chukwa-top /service/chukwa-top
+ln -sf %{_prefix}/tools/service/chukwa-ps /service/chukwa-ps
+echo "Congratulation!  You have successfully installed Chukwa."
+%preun
+echo
+%postun
+rm -f /service/chukwa-*
+%files
+%defattr(-,%{uid},%{gid})
+%{_prefix}
+%defattr(-,root,root)
+/etc/init.d/chukwa-data-processors
+/etc/init.d/chukwa-collector
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements.  See the NOTICE file distributed with
+#   this work for additional information regarding copyright ownership.
+#   The ASF licenses this file to You under the Apache License, Version 2.0
+#   (the "License"); you may not use this file except in compliance with
+#   the License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+# RPM Spec file for Chukwa v.@chukwaVersion@
+
+%define _topdir         @build.dir@
+%define _prefix         @rpm.prefix@
+%define _conf_dir       @rpm.conf.dir@
+%define uid             @rpm.uid@
+%define gid             @rpm.gid@
+%define name            chukwa
+%define summary         Distributed Computing Monitoring Framework.
+%define version         @chukwaVersion@
+%define release         @chukwaRelease@
+%define license         ASF 2.0
+%define group           Development/Monitoring
+%define source          %{name}-%{version}.tar.gz
+%define vendor          Apache Software Fundation
+%define packager        Hadoop Chukwa Team
+%define buildroot       %{_topdir}/BUILD
+
+Name:      %{name}
+Version:   %{version}
+Release:   %{release}
+Packager:  %{packager}
+Vendor:    %{vendor}
+License:   %{license}
+Summary:   %{summary}
+Group:     %{group}
+Source0:   %{source}
+Prefix:    %{_prefix}
+Buildroot: %{buildroot}
+
+%description
+Chukwa is the monitoring framework for large scale distributed
+clusters.
+
+%prep
+%setup -q
+%build
+mkdir -p %{buildroot}%{_prefix}
+if [ -d %{buildroot}%{_prefix} ]; then
+    rm -rf %{buildroot}%{_prefix}
+fi
+mv %{buildroot}/%{name}-%{version} %{buildroot}%{_prefix}
+cd %{buildroot}%{_prefix}
+mkdir -p %{buildroot}/etc/init.d
+
+cat %{buildroot}%{_prefix}/tools/init.d/chukwa-data-processors | \
+sed 's:CHUKWA_USER=chukwa:CHUKWA_USER=%{uid}:' | \
+sed 's:CHUKWA_HOME=/usr/local/chukwa:CHUKWA_HOME=%{_prefix}:' | \
+sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' > %{buildroot}/etc/init.d/chukwa-data-processors
+
+cat %{buildroot}%{_prefix}/tools/init.d/chukwa-collector | \
+sed 's:CHUKWA_USER=chukwa:CHUKWA_USER=%{uid}:' | \
+sed 's:CHUKWA_HOME=/usr/local/chukwa:CHUKWA_HOME=%{_prefix}:' | \
+sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' > %{buildroot}/etc/init.d/chukwa-collector
+
+cat %{buildroot}%{_prefix}/tools/service/chukwa-agent/run | \
+sed 's:CHUKWA_USER=chukwa:CHUKWA_USER=%{uid}:' | \
+sed 's:CHUKWA_HOME=/usr/local/chukwa:CHUKWA_HOME=%{_prefix}:' | \
+sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' \
+> %{buildroot}%{_prefix}/tools/service/chukwa-agent/run.new
+mv %{buildroot}%{_prefix}/tools/service/chukwa-agent/run.new %{buildroot}%{_prefix}/tools/service/chukwa-agent/run
+
+cat %{buildroot}%{_prefix}/tools/service/chukwa-df/run | \
+sed 's:CHUKWA_USER=chukwa:CHUKWA_USER=%{uid}:' | \
+sed 's:CHUKWA_HOME=/usr/local/chukwa:CHUKWA_HOME=%{_prefix}:' | \
+sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' \
+> %{buildroot}%{_prefix}/tools/service/chukwa-df/run.new
+mv %{buildroot}%{_prefix}/tools/service/chukwa-df/run.new %{buildroot}%{_prefix}/tools/service/chukwa-df/run
+
+cat %{buildroot}%{_prefix}/tools/service/chukwa-iostat/run | \
+sed 's:CHUKWA_USER=chukwa:CHUKWA_USER=%{uid}:' | \
+sed 's:CHUKWA_HOME=/usr/local/chukwa:CHUKWA_HOME=%{_prefix}:' | \
+sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' \
+> %{buildroot}%{_prefix}/tools/service/chukwa-iostat/run.new
+mv %{buildroot}%{_prefix}/tools/service/chukwa-iostat/run.new %{buildroot}%{_prefix}/tools/service/chukwa-iostat/run
+
+cat %{buildroot}%{_prefix}/tools/service/chukwa-netstat/run | \
+sed 's:CHUKWA_USER=chukwa:CHUKWA_USER=%{uid}:' | \
+sed 's:CHUKWA_HOME=/usr/local/chukwa:CHUKWA_HOME=%{_prefix}:' | \
+sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' \
+> %{buildroot}%{_prefix}/tools/service/chukwa-netstat/run.new
+mv %{buildroot}%{_prefix}/tools/service/chukwa-netstat/run.new %{buildroot}%{_prefix}/tools/service/chukwa-netstat/run
+
+cat %{buildroot}%{_prefix}/tools/service/chukwa-sar/run | \
+sed 's:CHUKWA_USER=chukwa:CHUKWA_USER=%{uid}:' | \
+sed 's:CHUKWA_HOME=/usr/local/chukwa:CHUKWA_HOME=%{_prefix}:' | \
+sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' \
+> %{buildroot}%{_prefix}/tools/service/chukwa-sar/run.new
+mv %{buildroot}%{_prefix}/tools/service/chukwa-sar/run.new %{buildroot}%{_prefix}/tools/service/chukwa-sar/run
+
+cat %{buildroot}%{_prefix}/tools/service/chukwa-top/run | \
+sed 's:CHUKWA_USER=chukwa:CHUKWA_USER=%{uid}:' | \
+sed 's:CHUKWA_HOME=/usr/local/chukwa:CHUKWA_HOME=%{_prefix}:' | \
+sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' \
+> %{buildroot}%{_prefix}/tools/service/chukwa-top/run.new
+mv %{buildroot}%{_prefix}/tools/service/chukwa-top/run.new %{buildroot}%{_prefix}/tools/service/chukwa-top/run
+
+cat %{buildroot}%{_prefix}/tools/service/chukwa-ps/run | \
+sed 's:CHUKWA_USER=chukwa:CHUKWA_USER=%{uid}:' | \
+sed 's:CHUKWA_HOME=/usr/local/chukwa:CHUKWA_HOME=%{_prefix}:' | \
+sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' \
+> %{buildroot}%{_prefix}/tools/service/chukwa-ps/run.new
+mv %{buildroot}%{_prefix}/tools/service/chukwa-ps/run.new %{buildroot}%{_prefix}/tools/service/chukwa-ps/run
+
+cat %{buildroot}%{_prefix}/tools/service/chukwa-collector/run | \
+sed 's:CHUKWA_USER=chukwa:CHUKWA_USER=%{uid}:' | \
+sed 's:CHUKWA_HOME=/usr/local/chukwa:CHUKWA_HOME=%{_prefix}:' | \
+sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' \
+> %{buildroot}%{_prefix}/tools/service/chukwa-collector/run.new
+mv %{buildroot}%{_prefix}/tools/service/chukwa-collector/run.new %{buildroot}%{_prefix}/tools/service/chukwa-collector/run
+
+cat %{buildroot}%{_prefix}/tools/service/chukwa-pbsnodes/run | \
+sed 's:CHUKWA_USER=chukwa:CHUKWA_USER=%{uid}:' | \
+sed 's:CHUKWA_HOME=/usr/local/chukwa:CHUKWA_HOME=%{_prefix}:' | \
+sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' \
+> %{buildroot}%{_prefix}/tools/service/chukwa-pbsnodes/run.new
+mv %{buildroot}%{_prefix}/tools/service/chukwa-pbsnodes/run.new %{buildroot}%{_prefix}/tools/service/chukwa-pbsnodes/run
+
+cat %{buildroot}%{_prefix}/tools/service/chukwa-torque/run | \
+sed 's:CHUKWA_USER=chukwa:CHUKWA_USER=%{uid}:' | \
+sed 's:CHUKWA_HOME=/usr/local/chukwa:CHUKWA_HOME=%{_prefix}:' | \
+sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' \
+> %{buildroot}%{_prefix}/tools/service/chukwa-torque/run.new
+mv %{buildroot}%{_prefix}/tools/service/chukwa-torque/run.new %{buildroot}%{_prefix}/tools/service/chukwa-torque/run
+
+cat %{buildroot}%{_prefix}/tools/service/chukwa-hdfsusage/run | \
+sed 's:CHUKWA_USER=chukwa:CHUKWA_USER=%{uid}:' | \
+sed 's:CHUKWA_HOME=/usr/local/chukwa:CHUKWA_HOME=%{_prefix}:' | \
+sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' \
+> %{buildroot}%{_prefix}/tools/service/chukwa-hdfsusage/run.new
+mv %{buildroot}%{_prefix}/tools/service/chukwa-hdfsusage/run.new %{buildroot}%{_prefix}/tools/service/chukwa-hdfsusage/run
+
+chmod a+x %{buildroot}%{_prefix}/tools/expire.sh
+chmod a+x %{buildroot}/etc/init.d/chukwa-*
+chmod -R a+x %{buildroot}%{_prefix}/tools/service/chukwa-*
+rm -rf %{buildroot}%{_prefix}/src
+rm -rf %{buildroot}%{_prefix}/build.xml
+%post
+if [ -d /service/chukwa-agent ]; then
+  if [ ! -L /service/chukwa-agent ]; then
+    rm -rf /service/chukwa-agent
+  fi
+fi
+if [ -d /service/chukwa-df ]; then
+  if [ ! -L /service/chukwa-df ]; then
+    rm -rf /service/chukwa-df
+  fi
+fi
+if [ -d /service/chukwa-iostat ]; then
+  if [ ! -L /service/chukwa-iostat ]; then
+    rm -rf /service/chukwa-iostat
+  fi
+fi
+if [ -d /service/chukwa-netstat ]; then
+  if [ ! -L /service/chukwa-netstat ]; then
+    rm -rf /service/chukwa-netstat
+  fi
+fi
+if [ -d /service/chukwa-ps ]; then
+  if [ ! -L /service/chukwa-ps ]; then
+    rm -rf /service/chukwa-ps
+  fi
+fi
+if [ -d /service/chukwa-sar ]; then
+  if [ ! -L /service/chukwa-sar ]; then
+    rm -rf /service/chukwa-sar
+  fi
+fi
+if [ -d /service/chukwa-top ]; then
+  if [ ! -L /service/chukwa-top ]; then
+    rm -rf /service/chukwa-top
+  fi
+fi
+mkdir -p %{_prefix}
+ln -sf %{_prefix}/tools/service/chukwa-agent /service/chukwa-agent
+ln -sf %{_prefix}/tools/service/chukwa-df /service/chukwa-df
+ln -sf %{_prefix}/tools/service/chukwa-iostat /service/chukwa-iostat
+ln -sf %{_prefix}/tools/service/chukwa-netstat /service/chukwa-netstat
+ln -sf %{_prefix}/tools/service/chukwa-sar /service/chukwa-sar
+ln -sf %{_prefix}/tools/service/chukwa-top /service/chukwa-top
+ln -sf %{_prefix}/tools/service/chukwa-ps /service/chukwa-ps
+echo "Congratulation!  You have successfully installed Chukwa."
+%preun
+echo
+%postun
+rm -f /service/chukwa-*
+%files
+%defattr(-,%{uid},%{gid})
+%{_prefix}
+%defattr(-,root,root)
+/etc/init.d/chukwa-data-processors
+/etc/init.d/chukwa-collector



Mime
View raw message