Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Mar 1998 08:21:51 +0200 (SAT)
From:      Reinier Bezuidenhout <rbezuide@oskar.nanoteq.co.za>
To:        pvh@leftside.wcape.school.za (Peter van Heusden)
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Doing a reboot from a CGI script?
Message-ID:  <199803050623.IAA03487@oskar.nanoteq.co.za>
In-Reply-To: <Pine.BSF.3.95.980305070901.15655E-100000@leftside.wcape.school.za> from Peter van Heusden at "Mar 5, 98 07:13:05 am"

next in thread | previous in thread | raw e-mail | index | archive | help
> Hi
> 
> I'm busy writing a set of scripts to make the management of a FreeBSD box
> easier (basically provide a WWW interface to manage UUCP, Squid, etc). One
> of the capabilities I want to build in is the ability to reboot the
> machine by pressing a button on a HTML page. I've tried doing this by
> running '/sbin/reboot' from the cgi-bin script (which is written in perl),
> but all that happens is that all processes are killed, and the reboot
> process stops there. I would imagine that somehow this means that the
> through killing the httpd process, the cgi-bin script and thus the reboot
> process have died. This seems to happen even if I fork a process from the
> cgi-bin script.
> 
> Is there any way to get around this? Has anyone tried this before?
> 

we do something similar by calling a shell script from a tcl
script  .... we use shutdown instead of reboot and it works fine ...

#!/bin/sh
fn=$1
shift
(/bin/sleep 2; /sbin/shutdown $* now > $fn 2>1 ) &


Hope this helps

Reinier

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199803050623.IAA03487>