Unlink fifo1 & fifo2 after each test
[gruntmaster-daemon.git] / gruntmaster-exec
CommitLineData
da905f9e
MG
1#!/usr/bin/perl -w
2use v5.14;
3use strict;
4
5use BSD::Resource qw/setrlimit RLIMIT_AS RLIMIT_FSIZE/;
6use sigtrap qw/XFSZ/;
7
8##################################################
9
10my ($mlimit, $olimit, @args) = @ARGV;
11
12setrlimit RLIMIT_AS, $mlimit, $mlimit or die $! if $mlimit;
13setrlimit RLIMIT_FSIZE, $olimit, $olimit or die $! if $olimit;
50cdf3cb 14
2c596b7a 15%ENV = (ONLINE_JUDGE => 1, PATH => $ENV{PATH}, HOME => $ENV{PATH});
da905f9e 16exec @args;
69c25408
MG
17
18__END__
19
20=encoding utf-8
21
22=head1 NAME
23
24gruntmaster-exec - Gruntmaster 6000 executor
25
26=head1 SYNOPSIS
27
28 gruntmaster-exec 20000000 111 echo 'Hello, world!'
29
30=head1 DESCRIPTION
31
32gruntmaster-exec is the script used by gruntmasterd to run programs.
33
34The 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.
35
36gruntmaster-exec sets the resource limits, cleans the environment (except for PATH and HOME), adds the ONLINE_JUDGE environment variable with value 1, and finally C<exec>s the given command.
37
38=head1 AUTHOR
39
40Marius Gavrilescu E<lt>marius@ieval.roE<gt>
41
42=head1 COPYRIGHT AND LICENSE
43
44Copyright (C) 2014 by Marius Gavrilescu
45
46This program is free software: you can redistribute it and/or modify
47it under the terms of the GNU Affero General Public License as published by
48the Free Software Foundation, either version 3 of the License, or
49(at your option) any later version.
This page took 0.01237 seconds and 4 git commands to generate.