Changeset bd341d4 for installer


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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.