I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Unverified Commit 19800847 authored by zzz's avatar zzz
Browse files

i2psnark standalone: Raise open files ulimit

copied from i2prouter script
parent 91e9d95d
No related branches found
No related tags found
No related merge requests found
......@@ -4,5 +4,33 @@
# The file jetty-i2psnark.xml must be present in the current directory.
# i2psnark will be accessed at http://127.0.0.1:8002/
#
# Raise the soft open files soft ulimit to this value, if able
OPEN_FILES_ULIMIT=2048
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
}
raiseopenfilesulimit
I2P="."
java -jar "$I2P/i2psnark.jar"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment