Changeset bd341d4


Ignore:
Timestamp:
Dec 11, 2017 2:14:46 PM (2 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
5f413ef
Parents:
34d879a
Message:

Startup: Raise open files ulimit (ticket #1967)
Fixup deb patch to match

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • debian/patches/0001-path-substitution.patch

    r34d879a rbd341d4  
    7777 # Priority at which to run the wrapper.  See "man nice" for valid priorities.
    7878 #  nice is only used if a priority is specified.
    79 @@ -177,77 +168,8 @@ if [ ! -e "$WRAPPER_CONF" ]; then
     79@@ -180,77 +171,8 @@ if [ ! -e "$WRAPPER_CONF" ]; then
    8080        exit 1
    8181 fi
     
    155155 then
    156156     COMMAND="$FIXED_COMMAND"
    157 @@ -1068,7 +990,6 @@ startwait() {
     157@@ -1078,7 +1000,6 @@ startwait() {
    158158         if [ "X$pid" = "X" ]
    159159         then
     
    163163             eval echo ' running: PID:$pid'
    164164         fi
    165 @@ -1871,7 +1792,7 @@ showUsage() {
     165@@ -1881,7 +1802,7 @@ showUsage() {
    166166 }
    167167 
     
    172172 
    173173 checkifstartingasroot() {
    174 @@ -1879,7 +1800,7 @@ checkifstartingasroot() {
     174@@ -1889,7 +1810,7 @@ checkifstartingasroot() {
    175175         echo "`gettext 'Running I2P as the root user is *not* recommended.'`"
    176176         showsetusermesg
     
    181181     fi
    182182 }
    183 @@ -1946,24 +1867,10 @@ docommand() {
     183@@ -1981,24 +1902,10 @@ docommand() {
    184184             status
    185185             ;;
  • installer/resources/i2prouter

    r34d879a rbd341d4  
    127127# flag for using upstart when installing (rather than init.d rc.d)
    128128USE_UPSTART=
     129
     130# Raise the soft open files soft ulimit to this value, if able
     131OPEN_FILES_ULIMIT=2048
    129132
    130133# Source the environment variables for the locale if $LANG isn't set
     
    18921895}
    18931896
     1897raiseopenfilesulimit() {
     1898    OPEN_FILES_SOFT=`ulimit -S -n` 2> /dev/null || return
     1899    if [ "$OPEN_FILES_SOFT" != "unlimited" ]
     1900    then
     1901        if [ "$OPEN_FILES_ULIMIT" -gt "$OPEN_FILES_SOFT" ]
     1902        then
     1903            OPEN_FILES_HARD=`ulimit -H -n` 2> /dev/null || return
     1904            if [ "$OPEN_FILES_HARD" != "unlimited" ]
     1905            then
     1906                if [ "$OPEN_FILES_ULIMIT" -gt "$OPEN_FILES_HARD" ]
     1907                then
     1908                    OPEN_FILES_ULIMIT="$OPEN_FILES_HARD"
     1909                fi
     1910            fi
     1911            if [ "$OPEN_FILES_ULIMIT" -gt "$OPEN_FILES_SOFT" ]
     1912            then
     1913                ulimit -S -n "$OPEN_FILES_ULIMIT" > /dev/null 2>&1
     1914            fi
     1915        fi
     1916    fi
     1917}
     1918
    18941919docommand() {
    18951920    case "$COMMAND" in
     
    19051930        'start')
    19061931            checkifstartingasroot
     1932            raiseopenfilesulimit
    19071933            if [ "$DIST_OS" = "macosx" -a -f "/Library/LaunchDaemons/${APP_PLIST}" ] ; then
    19081934                macosxstart
     
    19311957        'restart')
    19321958            checkifstartingasroot
     1959            raiseopenfilesulimit
    19331960            checkUser touchlock "$COMMAND"
    19341961            if [ ! -n "$FIXED_COMMAND" ] ; then
     
    19411968        'condrestart')
    19421969            checkifstartingasroot
     1970            raiseopenfilesulimit
    19431971            checkUser touchlock "$COMMAND"
    19441972            if [ ! -n "$FIXED_COMMAND" ] ; then
Note: See TracChangeset for help on using the changeset viewer.