1
0
Fork 0
mirror of https://github.com/perlbot/perlbuut synced 2025-06-07 10:45:40 -04:00

Change some limits, and fix timeout to not orphan things

This commit is contained in:
Ryan Voots 2017-05-06 05:49:45 -04:00
parent c7b44290c3
commit c4d914c308
3 changed files with 12 additions and 6 deletions

View file

@ -75,7 +75,9 @@ sub timeout {
warn "Trying to kill: ", $wheel->PID;
kill( 9, $wheel->PID );
kill( 'TERM', $wheel->PID ); # Try to avoid orphaning any sub processes first
sleep(3);
kill( 'KILL', $wheel->PID );
}
sub _append_output {

View file

@ -39,6 +39,7 @@ our %rule_sets = (
{syscall => 'exit_group'},
{syscall => 'rt_sigaction'},
{syscall => 'rt_sigprocmask'},
{syscall => 'rt_sigreturn'},
{syscall => 'getuid'},
{syscall => 'geteuid'},
@ -165,6 +166,9 @@ our %rule_sets = (
# Thread IPC writes, these might not be fixed but I don't know how to detect them otherwise
{syscall => 'write', rules => [[0, '==', 5]]},
{syscall => 'write', rules => [[0, '==', 7]]},
# TODO these should be defaults? locked down more?
{syscall => 'prctl',},
{syscall => 'poll',},
],
include => ['default', 'ruby_timer_thread'],
},

View file

@ -262,15 +262,15 @@ use Storable qw/nfreeze/; nfreeze([]); #Preload Nfreeze since it's loaded on dem
and
setrlimit(RLIMIT_STACK, $limit, $limit )
and
setrlimit(RLIMIT_NPROC, 4,4) # CHANGED to 3 for Ruby. Might take it away.
setrlimit(RLIMIT_NPROC, 10,10) # CHANGED to 3 for Ruby. Might take it away.
and
setrlimit(RLIMIT_NOFILE, 20,20)
setrlimit(RLIMIT_NOFILE, 30,30)
and
setrlimit(RLIMIT_OFILE, 20,20)
setrlimit(RLIMIT_OFILE, 30,30)
and
setrlimit(RLIMIT_OPEN_MAX,20,20)
setrlimit(RLIMIT_OPEN_MAX,30,30)
and
setrlimit(RLIMIT_LOCKS, 0,0)
setrlimit(RLIMIT_LOCKS, 5,5)
and
setrlimit(RLIMIT_AS,$limit,$limit)
and