# New after.rpms.sh script for farms Fermi Linux 7.3.  S. Timm 11/22/2002
#
echo "Farms install completed on `date`" > /var/log/instver.log
echo "/sbin/ifconfig -a " >> /var/log/instver.log
#**********************************************
#  /etc/syslog.conf
#**********************************************
#
cd /etc
if [ "$(grep "auth.*                                                    /var/log/secure" /etc/syslog.conf)" = "" ] ; then
        csplit -f auth syslog.conf /"var/log/secure"/+1
        echo "auth.*                                                    /var/log/secure" >> auth00

        cat auth01 >> auth00
        mv auth00 syslog.conf
        rm auth01
fi
#**********************************************
# Configure PCP so that it doesn't fail on startup.
#**********************************************
 
/usr/sbin/install-pcp-config generic
###############################################
#Enable and disable services
##############################################
/sbin/chkconfig sendmail off
/sbin/chkconfig --del kudzu
/sbin/chkconfig --del identd
/sbin/chkconfig --add nfslock
/sbin/chkconfig --level 2345 apmd off
/sbin/chkconfig --level 2345 xfs off
/sbin/chkconfig --level 2345 rhnsd off
/sbin/chkconfig --level 345 autofs on
/sbin/chkconfig --level 345 portmap on
/sbin/chkconfig --level 345 rstatd on
/sbin/chkconfig --level 2345 lpd off 
/sbin/chkconfig --level 2345 radvd off
/sbin/chkconfig eklogin on
/sbin/chkconfig klogin on
/sbin/chkconfig kshell on
/sbin/chkconfig telnet on
#
#temporary fix to beat the fact that krb5-login-fermi 
#gets installed before util-linux sometimes
#
if [ -s /bin/login ] && [ -s /usr/krb5/sbin/login.krb5 ]
then
	LOGINDIFF="`diff /bin/login /usr/krb5/sbin/login.krb5`"
	if [ "$LOGINDIFF" != "" ] 
	then
		mv /bin/login /bin/login.krb5.save
		cp -p /usr/krb5/sbin/login.krb5 /bin/login
        fi
fi
########################################################
# Run Voldemort's PULLRSYNC client
#######################################################
   
HOSTNAME="$(grep HOSTNAME /etc/sysconfig/network | grep -v DHCP | cut -d'=' -f2 | cut -d'.' -f1)"
echo $HOSTNAME > /tmp/hostname

if [ -e /sbin/pullrsync ]
then
    /sbin/pullrsync -H $HOSTNAME -I
fi

#need to figure out how to handle the error condition.
