From owner-freebsd-hackers Thu Mar 5 01:13:23 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id BAA09182 for freebsd-hackers-outgoing; Thu, 5 Mar 1998 01:13:23 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from mail.netcetera.dk (root@sleipner.netcetera.dk [194.192.207.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id BAA09173 for ; Thu, 5 Mar 1998 01:13:18 -0800 (PST) (envelope-from leifn@image.dk) Received: (from uucp@localhost) by mail.netcetera.dk (8.8.8/8.8.8) with UUCP id IAA10263 for freebsd-hackers@freebsd.org; Thu, 5 Mar 1998 08:49:32 +0100 Received: by swimsuit.swimsuit.roskildebc.dk (0.99.970109) id AA03870; 05 Mar 98 08:52:24 +0100 From: leifn@image.dk (Leif Neland) Date: 05 Mar 98 08:44:55 +0100 Subject: Doing a reboot from a CGI script? Message-ID: Organization: Fidonet: Swimsuit Safari. Go for it. To: freebsd-hackers@FreeBSD.ORG Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG At 05 Mar 98 06:13:05 Peter van Heusden (2:234/49.99) wrote to All regarding Doing a reboot from a CGI script? in area "freebsd-hacker" Pv> I'm busy writing a set of scripts to make the management of a Pv> FreeBSD box easier (basically provide a WWW interface to manage Pv> UUCP, Squid, etc). One of the capabilities I want to build in is Pv> the ability to reboot the machine by pressing a button on a HTML Pv> page. I've tried doing this by running '/sbin/reboot' from the Pv> cgi-bin script (which is written in perl), but all that happens Pv> is that all processes are killed, and the reboot process stops Pv> there. I would imagine that somehow this means that the through Pv> killing the httpd process, the cgi-bin script and thus the Pv> reboot process have died. This seems to happen even if I fork a Pv> process from the cgi-bin script. Pv> Pv> Is there any way to get around this? Has anyone tried this Pv> before? You could signal init instead. kill -KILL 1. I think -KILL is the right signal; see man init. Leif Neland leifn@image.dk --- |Fidonet: Leif Neland 2:234/49 |Internet: leifn@image.dk To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message