Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

mod_perl2 interactive startup

by amino (Initiate)
on Aug 17, 2009 at 16:20 UTC ( [id://789215]=perlquestion: print w/replies, xml ) Need Help??

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

Dear Monks -

I am in the process of porting a mod_perl app to mod_perl2.

The original mod_perl app has an interactive startup during which a DB password is prompted for.

During the mod_perl2 startup this feature works fine at first but mod_perl2 always does a restart and during the second restart STDERR is being redirected to the log files and STDIN is ignored.

So I am trying to figure out how to either:
1) Prevent the automatic restart or
2) Have STDERR and STDIN be tied to the terminal during the restart the same way they are during the initial start

Here info about my system: Apache/2.2.9 (Debian) mod_apreq2-20051231/2.6.0 mod_perl/2.0.4 Perl/v5.10.0

Thank you in advance for any help/insight.

---Amino

Replies are listed 'Best First'.
Re: mod_perl2 interactive startup
by perrin (Chancellor) on Aug 17, 2009 at 19:06 UTC

    Why don't you just check to see if the variable where you put the password has been filled in yet, and skip the terminal if you already have it?

    Incidentally, it's not really more secure to enter the password this way than to just keep it in a file that only the web server startup user can read.

      > Why don't you just check to see if the variable where you put the password has been filled in yet, and skip the terminal if you already have it?

      Because the mod_perl app restarts completely, so at least in the perl (as far as I know), no variables or structures persist.
      Is it possible to store stuff in the apache object?

      >Incidentally, it's not really more secure to enter the password this way than to just keep it in a file that only the web server startup user can read.

      I disagree. If the startup user account gets compromised its very easy to read a file and get a password. I believe the bar is a lot higher to extract data from a running program.
      How would you go about retrieving a password from a running program?
        The perl interpreter is not reset. If you put something in a global, it will still be there during the restart.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://789215]
Approved by zwon
Front-paged by MidLifeXis
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-03-19 05:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found