Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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

by Rooster (Initiate)
on Jan 16, 2014 at 15:47 UTC ( #1070817=perlquestion: print w/replies, xml ) Need Help??

Rooster has asked for the wisdom of the Perl Monks concerning the following question:

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!

  • Comment on How to Configure Perl (or maybe cgi / apache) to launch processes in a wrapper command?
  • Download Code

Replies are listed 'Best First'.
Re: How to Configure Perl (or maybe cgi / apache) to launch processes in a wrapper command?
by choroba (Bishop) on Jan 16, 2014 at 15:52 UTC
    Would suEXEC solve the issue?
    لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

      I looked into that, but I think suExec is already running on my system as if I do a top, I see the apache spawned processes owned by the correct users.

      As far as I can tell, the problem is the parent process, not so much the ownership. if the cgred daemon were reliable this wouldn't be an issue, but its not according to its own documentation. :(

        If suExec doesn't do what you need, there's also CGIwrap. CGIwrap also works on other webservers as it's a CGI itself.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1070817]
Approved by karlgoethebier
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2019-08-25 02:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?