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:

exec('ulimit -n 2048; vendor_process');
Ugly ugly ugly.

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.


In reply to Setting ulimit within perl for child processes by blue_cowdawg

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.