SO I've set up some linux control groups and they're working great....as long as I do everything from the command line. However, if I launch any processes from the web via apache using cgi to execute my perl scripts, every started process ends up being put into the control group of the user who started apache(because newly spawned processes inherit their parents ID).

After tons of research and trial and error, the only option I can think of is wrapping all the cgi files in a wrapper command that essentially executes as

cgexec -g subsystems:path_to_cgroup <command>`

and determine that by the linux user.

Is this really my only option?

BTW I'm using PAM to set the parent process on all the command line stuff, which I apparently can't use with apache as mod_auth_pam isn't supported anymore.

Cheers!


In reply to How to Configure Perl (or maybe cgi / apache) to launch processes in a wrapper command? by Rooster

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.