# Copyright (C) 2007 Platform Computing Inc # # This program is free software; you can redistribute it and/or modify # it under the terms of version 2 of the GNU General Public License as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # %define subversion 2 Summary: Ganglia server component Name: component-ganglia-server-v3_1_1 Version: 3.1.1 Release: 2 License: GPLv2 Group: System Environment/Base Vendor: Platform Computing Corporation BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot BuildArchitectures: noarch URL: http://ganglia.sf.net/ Source: %{name}-%{version}.%{subversion}.tar.gz Requires(post): coreutils, gawk, sed, python >= 2.4, /sbin/service, /sbin/chkconfig Requires: php, php-gd, ganglia, ganglia-gmetad, ganglia-web, ganglia-gmond, rrdtool Requires: httpd Requires: shadow-utils %description Ganglia component for installer node. %prep %setup -q -n %{name} %build %install rm -rf %{buildroot} mkdir -p $RPM_BUILD_ROOT/etc/rc.kusu.d install -m 0755 S18-gangliaconfig.rc.py $RPM_BUILD_ROOT/etc/rc.kusu.d %files /etc/rc.kusu.d/S18-gangliaconfig.rc.py* %pre %post if [ -e /var/lock/subsys/kusu-installer ]; then exit 0; fi ## Add the "ganglia" user getent group ganglia >/dev/null || groupadd -r ganglia -g 455 getent passwd ganglia >/dev/null || useradd -c "Ganglia Monitoring System" -u 455 -g ganglia -s /sbin/nologin -r -d /var/lib/ganglia ganglia 2> /dev/null || : # Generate config for gmond GCONF_DIR=/etc/ganglia if [ ! -e /var/lock/subsys/kusu-installer ]; then # Running outside of Anaconda if [ -f /etc/rc.kusu.d/S18-gangliaconfig.rc.py ]; then if [ -f $GCONF_DIR/gmond.conf ]; then /bin/env python /etc/rc.kusu.d/S18-gangliaconfig.rc.py fi fi #else # Running within Anaconda fi /sbin/chkconfig --add gmond /sbin/chkconfig --add gmetad /sbin/chkconfig gmond on /sbin/chkconfig gmetad on if [ -e /var/lock/subsys/kusu-installer ]; then exit 0; fi if [ ! -f /var/lock/subsys/httpd ]; then HTTPD_ACTION="start" else HTTPD_ACTION="restart" fi /sbin/service httpd $HTTPD_ACTION if [ ! -f /var/lock/subsys/gmetad ]; then /sbin/service gmetad start else /sbin/service gmetad restart fi if [ ! -f /var/lock/subsys/gmond ]; then /sbin/service gmond start else /sbin/service gmond restart fi %preun %postun /bin/cat << 'EOF' > /opt/kusu/lib/plugins/cfmclient/ganglia-server-v3_0.remove #!/bin/sh if [ -f /var/lock/subsys/httpd ]; then /sbin/service httpd restart fi if [ -f /var/lock/subsys/gmond ]; then /sbin/service gmond stop fi if [ -f /var/lock/subsys/gmetad ]; then /sbin/service gmetad stop fi /sbin/chkconfig --del gmond /sbin/chkconfig --del gmetad rpm -e ganglia-gmetad ganglia-web ganglia-gmond ganglia rpm -e php php-gd rm -f /opt/kusu/lib/plugins/cfmclient/ganglia-server-v3_0.remove EOF %clean rm -rf %{buildroot} %changelog * Wed Feb 04 2009 Hirwan Salleh 3.1.1-2 - Port to Kit ASK 0.2 * Fri Jan 30 2009 Hirwan Salleh 3.1.1-1 - Use Ganglia version 3.1.1 - Fix ganglia conf path * Thu Jul 17 2008 Mike Frisch 3.0-2 - Apache restarted correctly when Ganglia server component is installed (#112224) * Thu Apr 17 2008 Shawn Starr 3.0-1 - Initial release.