Shell Fork Bomb Protection - Exceptions?

Monotoko

Member
Mar 1, 2011
10
0
51
Hi Guys,

I have a user that runs a Minecraft server. This is a java file that has quite a high memory requirement, and when "Shell Fork Bomb Protection" is switched on it will not let me run the file under the user.

I would like the protection on for all accounts except the "minecraft" user, is this possible?

Daniel
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
While this cannot be done via the interface, it may be possible to revise using the limits set into /etc/profile location, which are the entries added by Shell Fork Bomb Protection:

#cPanel Added Limit Protections -- BEGIN

#unlimit so we can run the whoami
ulimit -n 4096 -u 14335 -m unlimited -d unlimited -s 8192 -c 1000000 -v unlimited 2>/dev/null

LIMITUSER=$USER
if [ -e "/usr/bin/whoami" ]; then
LIMITUSER=`/usr/bin/whoami`
fi
if [ "$LIMITUSER" != "root" ]; then
ulimit -n 100 -u 20 -m 200000 -d 200000 -s 8192 -c 200000 -v 200000 2>/dev/null
else
ulimit -n 4096 -u 14335 -m unlimited -d unlimited -s 8192 -c 1000000 -v unlimited 2>/dev/null
fi
#cPanel Added Limit Protections -- END
You could revise to add another user in the section where it has the if-else clauses to set the root and non-root user ulimits. You might also want to set the user's settings in /etc/security/limits.conf file.