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/branches/2.7@12874 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
wanghuaz 2012-05-22 14:10:09 +00:00
parent efc95378d8
commit 6c89f08856

View File

@ -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