From 7d2c65c9ad1b9063201607af6624520940bad01b Mon Sep 17 00:00:00 2001 From: wanghuaz Date: Tue, 22 May 2012 14:11:35 +0000 Subject: [PATCH] Fixing bug 3526601: Don't add duplicated lines into etc/security/limits.conf and also add the settings before '# End of file' git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@12875 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-IBMhpc/share/xcat/IBMhpc/IBMhpc.rhel.postinstall | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/xCAT-IBMhpc/share/xcat/IBMhpc/IBMhpc.rhel.postinstall b/xCAT-IBMhpc/share/xcat/IBMhpc/IBMhpc.rhel.postinstall index 5c37997c1..a88ebf8fb 100755 --- a/xCAT-IBMhpc/share/xcat/IBMhpc/IBMhpc.rhel.postinstall +++ b/xCAT-IBMhpc/share/xcat/IBMhpc/IBMhpc.rhel.postinstall @@ -74,7 +74,12 @@ fi #/usr/bin/sed -i 's/SOFTRESIDENTLIMIT=.*/SOFTRESIDENTLIMIT="unlimited"/g' $installroot/etc/sysconfig/ulimit #max locked memory -echo "* soft memlock unlimited" >> $installroot/etc/security/limits.conf -echo "* hard memlock unlimited" >> $installroot/etc/security/limits.conf +if ! grep "max locked memory" $installroot/etc/security/limits.conf >/dev/null 2>&1 ; then + sed -i "/# End of file/d" $installroot/etc/security/limits.conf + echo "#max locked memory" >> $installroot/etc/security/limits.conf + echo "* soft memlock unlimited" >> $installroot/etc/security/limits.conf + echo "* hard memlock unlimited" >> $installroot/etc/security/limits.conf + echo "# End of file" >> $installroot/etc/security/limits.conf +fi