Changeset 25991


Ignore:
Timestamp:
2011-03-10T06:58:02+01:00 (6 years ago)
Author:
obsy
Message:

[packages] transmission: set ulimit for open files

Currently, transmission daemon allows you to set the max number of open
files, but it can be more than allowed by the system, thus resulting in
errors if transmission uses more than set in ulimit. The following is
a patch to compare ulimit vs open_file_limit from /etc/config/transmission.
If the open_file_limit is greater than ulimit -n, then invoke
ulimit -n open_file_limit + 8 (since transmission's open file limit any
seems to pertain only to open torrent files)

Signed-off-by: Joe Roback <joe at roback.cc>

Location:
packages/net/transmission
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • packages/net/transmission/Makefile

    r25990 r25991  
    1010PKG_NAME:=transmission 
    1111PKG_VERSION:=2.22 
    12 PKG_RELEASE:=2 
     12PKG_RELEASE:=3 
    1313 
    1414PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 
  • packages/net/transmission/files/transmission.init

    r25538 r25991  
    4141        local enabled=0 
    4242        local run_as_usr='root' 
     43        local open_file_limit=0 
     44        local ulimit_files=`ulimit -n` 
    4345 
    4446        # disabled? 
     
    7678        chown -R $run_as_usr $config_dir 
    7779 
     80        config_get open_file_limit "$s" open_file_limit 
     81        let open_limit_files="$open_file_limit + 8" 
     82 
     83        if [ ${open_file_limit} -gt ${ulimit_files} ]; then 
     84                ulimit -n $open_limit_files 
     85        fi 
     86 
    7887        eval "$SSD -c $run_as_usr -q -b -x $BIN -S -- -g $config_dir" 
    7988} 
Note: See TracChangeset for help on using the changeset viewer.