forked from I2P_Developers/i2p.i2p
Startup: Raise open files ulimit (ticket #1967)
Fixup deb patch to match
This commit is contained in:
10
debian/patches/0001-path-substitution.patch
vendored
10
debian/patches/0001-path-substitution.patch
vendored
@ -76,7 +76,7 @@ Index: b/installer/resources/i2prouter
|
|||||||
|
|
||||||
# Priority at which to run the wrapper. See "man nice" for valid priorities.
|
# Priority at which to run the wrapper. See "man nice" for valid priorities.
|
||||||
# nice is only used if a priority is specified.
|
# nice is only used if a priority is specified.
|
||||||
@@ -177,77 +168,8 @@ if [ ! -e "$WRAPPER_CONF" ]; then
|
@@ -180,77 +171,8 @@ if [ ! -e "$WRAPPER_CONF" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -154,7 +154,7 @@ Index: b/installer/resources/i2prouter
|
|||||||
if [ -n "$FIXED_COMMAND" ]
|
if [ -n "$FIXED_COMMAND" ]
|
||||||
then
|
then
|
||||||
COMMAND="$FIXED_COMMAND"
|
COMMAND="$FIXED_COMMAND"
|
||||||
@@ -1068,7 +990,6 @@ startwait() {
|
@@ -1078,7 +1000,6 @@ startwait() {
|
||||||
if [ "X$pid" = "X" ]
|
if [ "X$pid" = "X" ]
|
||||||
then
|
then
|
||||||
eval echo " `gettext 'WARNING: $APP_LONG_NAME may have failed to start.'`"
|
eval echo " `gettext 'WARNING: $APP_LONG_NAME may have failed to start.'`"
|
||||||
@ -162,7 +162,7 @@ Index: b/installer/resources/i2prouter
|
|||||||
else
|
else
|
||||||
eval echo ' running: PID:$pid'
|
eval echo ' running: PID:$pid'
|
||||||
fi
|
fi
|
||||||
@@ -1871,7 +1792,7 @@ showUsage() {
|
@@ -1881,7 +1802,7 @@ showUsage() {
|
||||||
}
|
}
|
||||||
|
|
||||||
showsetusermesg() {
|
showsetusermesg() {
|
||||||
@ -171,7 +171,7 @@ Index: b/installer/resources/i2prouter
|
|||||||
}
|
}
|
||||||
|
|
||||||
checkifstartingasroot() {
|
checkifstartingasroot() {
|
||||||
@@ -1879,7 +1800,7 @@ checkifstartingasroot() {
|
@@ -1889,7 +1810,7 @@ checkifstartingasroot() {
|
||||||
echo "`gettext 'Running I2P as the root user is *not* recommended.'`"
|
echo "`gettext 'Running I2P as the root user is *not* recommended.'`"
|
||||||
showsetusermesg
|
showsetusermesg
|
||||||
echo
|
echo
|
||||||
@ -180,7 +180,7 @@ Index: b/installer/resources/i2prouter
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -1946,24 +1867,10 @@ docommand() {
|
@@ -1981,24 +1902,10 @@ docommand() {
|
||||||
status
|
status
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
@ -127,6 +127,9 @@ WAIT_FOR_STARTED_TIMEOUT=120
|
|||||||
# flag for using upstart when installing (rather than init.d rc.d)
|
# flag for using upstart when installing (rather than init.d rc.d)
|
||||||
USE_UPSTART=
|
USE_UPSTART=
|
||||||
|
|
||||||
|
# Raise the soft open files soft ulimit to this value, if able
|
||||||
|
OPEN_FILES_ULIMIT=2048
|
||||||
|
|
||||||
# Source the environment variables for the locale if $LANG isn't set
|
# Source the environment variables for the locale if $LANG isn't set
|
||||||
# If you want to set custom locale variables for I2P,
|
# If you want to set custom locale variables for I2P,
|
||||||
# you may comment out this block and set them yourself here.
|
# you may comment out this block and set them yourself here.
|
||||||
@ -1891,6 +1894,28 @@ checkifstartingasroot() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
raiseopenfilesulimit() {
|
||||||
|
OPEN_FILES_SOFT=`ulimit -S -n` 2> /dev/null || return
|
||||||
|
if [ "$OPEN_FILES_SOFT" != "unlimited" ]
|
||||||
|
then
|
||||||
|
if [ "$OPEN_FILES_ULIMIT" -gt "$OPEN_FILES_SOFT" ]
|
||||||
|
then
|
||||||
|
OPEN_FILES_HARD=`ulimit -H -n` 2> /dev/null || return
|
||||||
|
if [ "$OPEN_FILES_HARD" != "unlimited" ]
|
||||||
|
then
|
||||||
|
if [ "$OPEN_FILES_ULIMIT" -gt "$OPEN_FILES_HARD" ]
|
||||||
|
then
|
||||||
|
OPEN_FILES_ULIMIT="$OPEN_FILES_HARD"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [ "$OPEN_FILES_ULIMIT" -gt "$OPEN_FILES_SOFT" ]
|
||||||
|
then
|
||||||
|
ulimit -S -n "$OPEN_FILES_ULIMIT" > /dev/null 2>&1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
docommand() {
|
docommand() {
|
||||||
case "$COMMAND" in
|
case "$COMMAND" in
|
||||||
'console')
|
'console')
|
||||||
@ -1904,6 +1929,7 @@ docommand() {
|
|||||||
|
|
||||||
'start')
|
'start')
|
||||||
checkifstartingasroot
|
checkifstartingasroot
|
||||||
|
raiseopenfilesulimit
|
||||||
if [ "$DIST_OS" = "macosx" -a -f "/Library/LaunchDaemons/${APP_PLIST}" ] ; then
|
if [ "$DIST_OS" = "macosx" -a -f "/Library/LaunchDaemons/${APP_PLIST}" ] ; then
|
||||||
macosxstart
|
macosxstart
|
||||||
elif [ "$DIST_OS" = "linux" -a -f "/etc/init/${APP_NAME}.conf" ] ; then
|
elif [ "$DIST_OS" = "linux" -a -f "/etc/init/${APP_NAME}.conf" ] ; then
|
||||||
@ -1930,6 +1956,7 @@ docommand() {
|
|||||||
|
|
||||||
'restart')
|
'restart')
|
||||||
checkifstartingasroot
|
checkifstartingasroot
|
||||||
|
raiseopenfilesulimit
|
||||||
checkUser touchlock "$COMMAND"
|
checkUser touchlock "$COMMAND"
|
||||||
if [ ! -n "$FIXED_COMMAND" ] ; then
|
if [ ! -n "$FIXED_COMMAND" ] ; then
|
||||||
shift
|
shift
|
||||||
@ -1940,6 +1967,7 @@ docommand() {
|
|||||||
|
|
||||||
'condrestart')
|
'condrestart')
|
||||||
checkifstartingasroot
|
checkifstartingasroot
|
||||||
|
raiseopenfilesulimit
|
||||||
checkUser touchlock "$COMMAND"
|
checkUser touchlock "$COMMAND"
|
||||||
if [ ! -n "$FIXED_COMMAND" ] ; then
|
if [ ! -n "$FIXED_COMMAND" ] ; then
|
||||||
shift
|
shift
|
||||||
|
Reference in New Issue
Block a user