File tree Expand file tree Collapse file tree
centos/SYSCONFDIR/rc.d/init.d
fedora/SYSCONFDIR/rc.d/init.d
rhel/SYSCONFDIR/rc.d/init.d Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,6 +50,16 @@ stop() {
5050 fi
5151}
5252
53+ set_ulimit () {
54+ fd_limit=` ulimit -n`
55+ if [ " $fd_limit " != " 4096" ]; then
56+ user=` whoami`
57+ if [ $user == " root" ]; then
58+ ulimit -n 4096
59+ fi
60+ fi
61+ }
62+
5363# See how we were called.
5464case " $1 " in
5565 status)
@@ -62,9 +72,11 @@ case "$1" in
6272 restart)
6373 stop
6474 set start
75+ set_ulimit
6576 . /etc/rc.d/init.d/tomcat6
6677 ;;
6778 * )
79+ set_ulimit
6880 . /etc/rc.d/init.d/tomcat6
6981esac
7082
Original file line number Diff line number Diff line change @@ -25,6 +25,15 @@ if [ -r /lib/lsb/init-functions ]; then
2525 . /lib/lsb/init-functions
2626fi
2727
28+ set_ulimit () {
29+ fd_limit=` ulimit -n`
30+ if [ " $fd_limit " != " 4096" ]; then
31+ user=` whoami`
32+ if [ $user == " root" ]; then
33+ ulimit -n 4096
34+ fi
35+ fi
36+ }
2837
2938NAME=" $( basename $0 ) "
3039stop () {
@@ -62,9 +71,11 @@ case "$1" in
6271 restart)
6372 stop
6473 set start
74+ set_ulimit
6575 . /etc/rc.d/init.d/tomcat6
6676 ;;
6777 * )
78+ set_ulimit
6879 . /etc/rc.d/init.d/tomcat6
6980esac
7081
Original file line number Diff line number Diff line change @@ -50,6 +50,16 @@ stop() {
5050 fi
5151}
5252
53+ set_ulimit () {
54+ fd_limit=` ulimit -n`
55+ if [ " $fd_limit " != " 4096" ]; then
56+ user=` whoami`
57+ if [ $user == " root" ]; then
58+ ulimit -n 4096
59+ fi
60+ fi
61+ }
62+
5363# See how we were called.
5464case " $1 " in
5565 status)
@@ -62,9 +72,11 @@ case "$1" in
6272 restart)
6373 stop
6474 set start
75+ set_ulimit
6576 . /etc/rc.d/init.d/tomcat6
6677 ;;
6778 * )
79+ set_ulimit
6880 . /etc/rc.d/init.d/tomcat6
6981esac
7082
Original file line number Diff line number Diff line change @@ -389,9 +389,11 @@ id %{name} > /dev/null 2>&1 || /usr/sbin/useradd -M -c "Cloud.com unprivileged u
389389 -r -s /bin/sh -d %{_sharedstatedir }/%{name }/management %{name }|| true
390390
391391# set max file descriptors for cloud user to 4096
392- sed -i /"cloud"/d /etc/security/limits.conf
393- echo "cloud hard nofile 4096" >> /etc/security/limits.conf
394- echo "cloud soft nofile 4096" >> /etc/security/limits.conf
392+ grep "cloud" /etc/security/limits.conf &> /dev/null
393+ if [ $? -eq 1 ]; then
394+ echo "cloud hard nofile 4096" >> /etc/security/limits.conf
395+ echo "cloud soft nofile 4096" >> /etc/security/limits.conf
396+ fi
395397rm -rf %{_localstatedir }/cache/%{name }
396398# user harcoded here, also hardcoded on wscript
397399
You can’t perform that action at this time.
0 commit comments