# 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 # # # Summary: Lava compute component Name: component-lava-compute-v1_0 Version: 1.0 Release: 5 License: GPLv2 Group: System Environment/Base Vendor: Platform Computing Corporation BuildArch: noarch Requires: lava = 1.0, coreutils %description This package is a meta package for Lava %prep %files %pre %post if [ ! -d /opt/kusu/lib/plugins/cfmclient ]; then /bin/mkdir -p /opt/kusu/lib/plugins/cfmclient fi # Place any component post install code here /bin/cat << 'EOF' > /opt/kusu/lib/plugins/cfmclient/lava-restart #!/bin/sh if [ -f /var/lock/subsys/lava ]; then # lava service is running source /etc/profile.nii checksum=`cat /opt/kusu/etc/cfmfiles.lst | grep "/opt/kusu/cfm/${NII_NGID}/etc/lava/conf/lsf.cluster.lava" | cut -d' ' -f6` actual_checksum=`md5sum /etc/lava/conf/lsf.cluster.lava | cut -d' ' -f1` if [ "$checksum" != "$actual_checksum" ]; then badmin hstartup fi else # The lava service will not be running if lava was # started on the compute node before cfmclient had # updated the lava config files. This is possible # on SLES/opensuse because they run init scripts in # parallel. So here we simply do a stop and start # of the lava service. source /etc/profile.d/lava.sh /sbin/service lava stop && /sbin/service lava start fi EOF # Exit here if in nodeinstaller environment. Otherwise # the compute node will fail to provision. if [ -f /var/lock/subsys/kusu-installer ]; then exit 0; fi # Check for lsf conf and start/restart lava LSF_CONF=/etc/lava/conf/lsf.conf if [ -f $LSF_CONF ]; then if [ ! -f /var/lock/subsys/lava ]; then /sbin/service lava start > /dev/null 2>&1 else /sbin/service lava stop && /sbin/service lava start > /dev/null 2>&1 fi fi %preun %postun rm -rf /opt/kusu/lib/plugins/cfmclient/lava-restart # Place any component uninstall code here # Generate scripts for the CFM to remove other packages /bin/cat << 'EOF' > /opt/kusu/lib/plugins/cfmclient/%{name}.remove #!/bin/sh rpm -e lava rm -rf /opt/kusu/lib/plugins/cfmclient/%{name}.remove EOF %changelog * Wed Feb 4 2009 Meng Kuan 1.0-5 - Port lava kit to Kit ASK 0.2. * Tue Feb 3 2009 Meng Kuan 1.0-4 - Final release of the old-style kits * Mon Apr 14 2008 Shawn Starr 1.0-3 - Don't create log directory * Thu Mar 27 2008 Mike Frisch 1.0-1 - Do not remove user in postun * Wed Jan 30 2008 Shawn Starr 1.0-0 - Initial release of Lava 1.0