Bug 10679 - increase file descriptor limit to 4096

Resolved fixed
This commit is contained in:
frank 2011-07-11 15:06:39 -07:00
parent f5d5ed5dce
commit 5a9233f4ea
4 changed files with 40 additions and 3 deletions

View File

@ -50,6 +50,16 @@ stop() {
fi
}
set_ulimit() {
fd_limit=`ulimit -n`
if [ "$fd_limit" != "4096" ]; then
user=`whoami`
if [ $user == "root" ]; then
ulimit -n 4096
fi
fi
}
# See how we were called.
case "$1" in
status)
@ -62,9 +72,11 @@ case "$1" in
restart)
stop
set start
set_ulimit
. /etc/rc.d/init.d/tomcat6
;;
*)
set_ulimit
. /etc/rc.d/init.d/tomcat6
esac

View File

@ -25,6 +25,15 @@ if [ -r /lib/lsb/init-functions ]; then
. /lib/lsb/init-functions
fi
set_ulimit() {
fd_limit=`ulimit -n`
if [ "$fd_limit" != "4096" ]; then
user=`whoami`
if [ $user == "root" ]; then
ulimit -n 4096
fi
fi
}
NAME="$(basename $0)"
stop() {
@ -62,9 +71,11 @@ case "$1" in
restart)
stop
set start
set_ulimit
. /etc/rc.d/init.d/tomcat6
;;
*)
set_ulimit
. /etc/rc.d/init.d/tomcat6
esac

View File

@ -50,6 +50,16 @@ stop() {
fi
}
set_ulimit() {
fd_limit=`ulimit -n`
if [ "$fd_limit" != "4096" ]; then
user=`whoami`
if [ $user == "root" ]; then
ulimit -n 4096
fi
fi
}
# See how we were called.
case "$1" in
status)
@ -62,9 +72,11 @@ case "$1" in
restart)
stop
set start
set_ulimit
. /etc/rc.d/init.d/tomcat6
;;
*)
set_ulimit
. /etc/rc.d/init.d/tomcat6
esac

View File

@ -389,9 +389,11 @@ id %{name} > /dev/null 2>&1 || /usr/sbin/useradd -M -c "Cloud.com unprivileged u
-r -s /bin/sh -d %{_sharedstatedir}/%{name}/management %{name}|| true
# set max file descriptors for cloud user to 4096
sed -i /"cloud"/d /etc/security/limits.conf
echo "cloud hard nofile 4096" >> /etc/security/limits.conf
echo "cloud soft nofile 4096" >> /etc/security/limits.conf
grep "cloud" /etc/security/limits.conf &>/dev/null
if [ $? -eq 1 ]; then
echo "cloud hard nofile 4096" >> /etc/security/limits.conf
echo "cloud soft nofile 4096" >> /etc/security/limits.conf
fi
rm -rf %{_localstatedir}/cache/%{name}
# user harcoded here, also hardcoded on wscript