blue_cowdawg has asked for the wisdom of the Perl Monks concerning the following question:
Greetings Monks,
I am in the process of re-engineering some startup scripts
for a very poorly ported application. What's so poor about
the application? Oh, I'd have to digress greatly from
the subject at hand and it would end up soundling like a
rant.
One of the items that needs to be done according to the vendor is running "ulimit -n 2048" prior to forking off each of about 8 processes that need to be started in a particular order. Looking up online doco for "ulimit" I find that this is a shell built in and not a seperate executable much to my horror. Further reading reveals that this is setting the maximum number of file handles the child can open at a time.
Right now I have the portion of the script doing something that I think is totally ignorant and want to come up with a way to fix it. Currently I have:
Ugly ugly ugly.exec('ulimit -n 2048; vendor_process');
Has anyone ever come up with a Pure Perl® way of doing this? Is there a module out there that provides this functionality (yes I've already searched CPAN).
A search of CPAN for the word "ulimit" gave me a reference to psh but not anything else.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Setting ulimit within perl for child processes
by Fletch (Bishop) on Apr 19, 2004 at 14:12 UTC | |
by blue_cowdawg (Monsignor) on Apr 19, 2004 at 14:49 UTC |