karellodewijk Added an optional command line parameter
7a76cae Aug 28, 2011
Added an optional command line parameter
Evrything main.rb will be interpreted as a command prefix. And every shell
command will be prefixed by the command prefix.

This basically allows you to run all commands as a different user.

The problem this is meant to solve is the fork problem. programs generally
have access to the fork system call or can open child processes, bring enough
child processes online and you can crash a system. The system crash
is easily preventable by setting limits on the number of processes the
user running the bot can create. But when someone writes a program that
forks indefinatly it will dry up all resources of that user account, and the
bot will stop functioning. The solution is to run the bot from a different
account as the child processes.

However theoretically possible I can't get it to work. THe difficulty I'm having is
if I prefix all commands with sudo -u user, then the limits set for user will be ignored.
If I prefix all commands with su - user -c, then the limits will be respected. But
I can not make this command passwordless. But I'm sure it can be made to work :)
7a76cae