I'm trying to achieve similar functionality in a server for community programming and I've drafted this to wrap up another take on oneide's functions: From a Perl CGI I build a script like this (not even pseudocode):
compiler_response = timeout (params) compiler (params)
result = timeout compiledprogram (params)
save result in database
I think timeout is the tool I need to restrain the program from executing or compiling more than X seconds, The problem I have is that I need to limit the compiled program from writing to anything other than STDOUT or reading from anything other than STDIN. Also I need to limit the size of the program to a certain limit, 128KB for example, and the ammount of RAM it can use, 64 MB for example.
What are the proper tools to do this from bash? Thanks in advance.