Roxen.git/
server/
start
Branch:
Tag:
Non-build tags
All tags
No tags
2000-11-20
2000-11-20 08:12:16 by Per Hedbor <ph@opera.com>
001f83c894874a6f11ca04cb663d91b26b1b3cf5 (
31
lines) (+
14
/-
17
)
[
Show
|
Annotate
]
Branch:
5.2
Better
Rev: server/start:1.136
1:
#!/bin/sh #
-
# $Id: start,v 1.
135
2000/11/20
07
:
48
:
27
per Exp $
+
# $Id: start,v 1.
136
2000/11/20
08
:
12
:
16
per Exp $
### If --silent-start is given as the first argument, ### nothing will be printed to stdout by the script.
20:
fi }
-
unlimit_fds() {
-
nfds=32
-
mnfds=32
-
while [ $nfds -lt "999999999" ] ; do
-
nfds=`expr $nfds \* 2`
-
if ulimit -n $nfds ; then
-
mnfds="$nfds"
-
fi
-
done
-
dp "Maximum number of open FDs: $mnfds"
-
if [ "$mnfds" -lt 1024 ] ; then
-
dp "Warning: This is dangerously low"
-
fi
-
}
+
-
+
change_owner( ) { uid="$1"; shift gid="$1"; shift
649:
start_roxen() { check_owner
-
unlimit_fds
+
+
nfds=2147483647
+
while [ $nfds -gt "`ulimit -n`" ] ; do
+
nfds=`expr $nfds / 2`
+
if ulimit -n $nfds 2>/dev/null; then
+
dp "Maximum number of open FDs: `ulimit -n`"
+
if [ "`ulimit -n`" -lt 1024 ] ; then
+
dp "Warning: This is dangerously low"
+
fi
+
fi
+
done
+
if [ x$remove_dumped = x1 ] ; then remove_old_dot_o_files "user request" fi