mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Bug 10679 - increase file descriptor limit to 4096
Resolved fixed
This commit is contained in:
parent
f5d5ed5dce
commit
5a9233f4ea
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user