G'day Ryan,

Ryan wrote:
> Is there a way to allow mod_perl to restart the server?  I've tried  
> writing a shell script that does it and using the Sudo module to  
> execute the shell script, but it doesn't seem to work.  Sorry, I know  
> this belongs in a different mailing list but I thought someone here  
> might have the knowledge I'm looking for.  Thanks!

Saying how it "doesn't seem to work" will help greatly in debugging. ;)  If
you're finding it's stopping the server, but not starting it again, then it
may be that stopping apache is killing its descendent processes, which
includes your start-stop scripts.

If your shell script was actually a Perl program, you *may* find that you can:

        use POSIX qw(setsid);
        setsid();

which will at least give you a new session.  The Proc::Daemon module gives a
better description on how to make sure that your restart program is fully
disassociated with its parent process (as much as possible).

If your problem is with managing permissions, you may find it's easier to
have a cron job with runs with the permissions you need, and looks for the
existence of a given file ever N minutes.  If the file exists, it deletes
it[1] and restarts the apache server.  Then you just need code to create a
file in order to restart the server.

Of course, this is all a stab in the dark at diagnosing your problem.  YMMV.

Cheerio,

        Paul

[1] If you're paranoid about race conditions, you open the file, flock it
for LOCK_EX | LOCK_NB, and then continue only if that's successful.

-- 
Paul Fenwick <[EMAIL PROTECTED]> | http://perltraining.com.au/
Director of Training                   | Ph:  +61 3 9354 6001
Perl Training Australia                | Fax: +61 3 9354 2681

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to