One of the things I want to do is run the generated script (in my application) as a limited user. So I create a
limiteduser . Then I can set say fork limits like this :
limiteduser hard nproc 300.
Is this then the right way of running a script as
sudo -u limiteduser perl myscript.pl
Secondly, what if I had concurrent requests that forked and executed and ran the above code simultaneously, with different scripts. Would that cause problems? I heard it would, if two processes ran on the same user or something?
Specifically I'm running on ubuntu but I assume this applies to any *nix distro?
Update: Also, I plan to use Time::Out to timeout a script if it takes too long so ideally I should have a limited number of processes running.