X-Git-Url: http://git.ieval.ro/?p=gruntmaster-daemon.git;a=blobdiff_plain;f=gruntmaster-exec;h=1bb57583633f53402c9e83cad2ceeb256f2f4c16;hp=ffdc7bfc3f4ef84a7b083fff1a493f6776f1031a;hb=498646e00c11ecb137eac12e4eab92b7f8a3fb98;hpb=50cdf3cbd2e4646d4f1712931403a91c16072165 diff --git a/gruntmaster-exec b/gruntmaster-exec index ffdc7bf..1bb5758 100755 --- a/gruntmaster-exec +++ b/gruntmaster-exec @@ -12,5 +12,38 @@ my ($mlimit, $olimit, @args) = @ARGV; setrlimit RLIMIT_AS, $mlimit, $mlimit or die $! if $mlimit; setrlimit RLIMIT_FSIZE, $olimit, $olimit or die $! if $olimit; -%ENV = (ONLINE_JUDGE => 1, PATH => $ENV{PATH}); +%ENV = (ONLINE_JUDGE => 1, PATH => $ENV{PATH}, HOME => $ENV{PATH}); exec @args; + +__END__ + +=encoding utf-8 + +=head1 NAME + +gruntmaster-exec - Gruntmaster 6000 executor + +=head1 SYNOPSIS + + gruntmaster-exec 20000000 111 echo 'Hello, world!' + +=head1 DESCRIPTION + +gruntmaster-exec is the script used by gruntmasterd to run programs. + +The first argument is the address space limit (in bytes), the second argument is the output limit (also in bytes). The rest of the arguments are the command that should be run and its arguments. + +gruntmaster-exec sets the resource limits, cleans the environment (except for PATH and HOME), adds the ONLINE_JUDGE environment variable with value 1, and finally Cs the given command. + +=head1 AUTHOR + +Marius Gavrilescu Emarius@ieval.roE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2014 by Marius Gavrilescu + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version.