On Tue, Apr 09, 2002 at 07:19:44PM +0200, Dave Raven wrote:
:
: I need to reboot a FreeBSD 4.5-STABLE
: computer using php + apache. I have a
: small wrapper which runs the reboot
: command as root, but it freezes half way
: through and the box hangs.
:
: I'm thinking that the reboot process is
: killing apache, and in effect killing itself.
: How might I get around this?
How about launching a shell script that reboots the server as its own
process? For example, make a script at /etc/shutdown containing this:
#!/bin/sh
/sbin/reboot
then in your PHP script do something like:
<?php
exec('/usr/bin/nohup /etc/shutdown 1>/dev/null/ 2>&1 &');
?>
--
Eugene Lee
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php