Merge pull request #1322 from jordansissel/fix-sysv-init

Correctly set nice and ulimit -n
This commit is contained in:
Jordan Sissel 2014-05-01 12:26:28 -07:00
commit 7be12796bf

View file

@ -49,10 +49,13 @@ start() {
JAVA_OPTS=${LS_JAVA_OPTS}
export PATH HOME JAVA_OPTS LS_HEAP_SIZE LS_JAVA_OPTS LS_USE_GC_LOGGING
# set ulimit as (root, presumably) first, before we drop privileges
ulimit -n ${LS_OPEN_FILES}
# Run the program!
chroot --userspec $LS_USER:$LS_GROUP / sh -c "
nice -n ${LS_NICE} chroot --userspec $LS_USER:$LS_GROUP / sh -c "
cd $LS_HOME
nice ${LS_NICE}
ulimit -n ${LS_OPEN_FILES}
exec \"$program\" $args
" > "${LS_LOG_DIR}/$name.stdout" 2> "${LS_LOG_DIR}/$name.err" &