diff --git a/packaging/centos63/cloud-agent.rc b/packaging/centos63/cloud-agent.rc index aad95828f6d..45ab0b3c8fd 100755 --- a/packaging/centos63/cloud-agent.rc +++ b/packaging/centos63/cloud-agent.rc @@ -65,7 +65,18 @@ PCP=`ls /usr/share/cloudstack-agent/plugins/*.jar 2>/dev/null | tr '\n' ':' | se # AgentShell implements the JSVC daemon methods export CLASSPATH="/usr/share/java/commons-daemon.jar:$ACP:$PCP:/etc/cloudstack/agent:/usr/share/cloudstack-common/scripts" +set_ulimit() { + fd_limit=`ulimit -n` + if [ "$fd_limit" != "65536" ]; then + user=`whoami` + if [ $user == "root" ]; then + ulimit -n 65536 + fi + fi +} + start() { + set_ulimit echo -n $"Starting $PROGNAME: " if hostname --fqdn >/dev/null 2>&1 ; then $JSVC -Djava.io.tmpdir="$TMP" -Xms256m -Xmx2048m -cp "$CLASSPATH" -pidfile "$PIDFILE" \ diff --git a/packaging/centos63/cloud-management.rc b/packaging/centos63/cloud-management.rc index 6d2874854ee..b500b2604d8 100755 --- a/packaging/centos63/cloud-management.rc +++ b/packaging/centos63/cloud-management.rc @@ -71,10 +71,10 @@ stop() { set_ulimit() { fd_limit=`ulimit -n` - if [ "$fd_limit" != "4096" ]; then + if [ "$fd_limit" != "65536" ]; then user=`whoami` if [ $user == "root" ]; then - ulimit -n 4096 + ulimit -n 65536 fi fi } diff --git a/server/conf/cloudstack-limits.conf.in b/server/conf/cloudstack-limits.conf.in index c97f0b5603a..fbe588b00f6 100644 --- a/server/conf/cloudstack-limits.conf.in +++ b/server/conf/cloudstack-limits.conf.in @@ -17,5 +17,5 @@ # Specific limits for the CloudStack management server which # runs under the user 'cloud' by default -@MSUSER@ hard nofile 4096 -@MSUSER@ soft nofile 4096 +@MSUSER@ hard nofile 65536 +@MSUSER@ soft nofile 65536