From owner-freebsd-hackers Wed Mar 4 22:27:43 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id WAA13291 for freebsd-hackers-outgoing; Wed, 4 Mar 1998 22:27:43 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from oskar.nanoteq.co.za (oskar.nanoteq.co.za [196.37.91.10]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id WAA13278 for ; Wed, 4 Mar 1998 22:27:27 -0800 (PST) (envelope-from rbezuide@oskar.nanoteq.co.za) Received: (from rbezuide@localhost) by oskar.nanoteq.co.za (8.8.8/8.8.5) id IAA03487; Thu, 5 Mar 1998 08:23:06 +0200 (SAT) From: Reinier Bezuidenhout Message-Id: <199803050623.IAA03487@oskar.nanoteq.co.za> Subject: Re: Doing a reboot from a CGI script? In-Reply-To: from Peter van Heusden at "Mar 5, 98 07:13:05 am" To: pvh@leftside.wcape.school.za (Peter van Heusden) Date: Thu, 5 Mar 1998 08:21:51 +0200 (SAT) Cc: freebsd-hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL28 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > 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