Re: Rebooting
| From: | Eugene Lee | Date: | Tue, 09 Apr 2002 17:47:52 +0000 |
| Subject: | Re: Rebooting | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-92266@lists.php.net to get a copy of this message | ||
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
eugene@fsck.net