Subject: Re: Action of halt/reboot from scripts
To: None <current-users@NetBSD.ORG>
From: Stephen Borrill <>
List: current-users
Date: 02/12/1998 18:45:36
On Thu 12 Feb, Mike Long wrote:
> >Date: Thu, 12 Feb 1998 14:20:48 +0000 (GMT)
> >From: Stephen Borrill <>
> >If you halt or exec halt in a sh script, the machine kills all the
> >processes except for the current login shell which remains functional
> >(the script itself is terminated). The machine will shutdown eventually.
> >This is obviously a bit confusing but not a problem. If you try to
> >execute halt from a Apache script, then most of the processes die, but
> >not all (inetd, nfsd, mountd,init, etc. are left). Any shells open
> >continue to be usable. You then still need to type halt at an open shell
> >to shut the machine down (Woe betide you if you don't have an open
> >shell; all the getty processes have died so you can't log in and so you
> >can't sync the discs).
> Have you considered using shutdown(8) instead of halt or reboot?

Yes, that produces the same outcome (using shutdown -fr now). The
machine _looks_ as though it is shutting down from the messages on the
console, but it doesn't get any further than killing most of the
processes (This is from the CGI script, BTW).

Stephen Borrill, Network Computer Technical Manager
Xemplar Education Ltd                    Tel: +44 (0) 1223 724 267
The Quorum, Barnwell Road                Fax: +44 (0) 1223 724 324
Cambridge, CB5 8RE, United Kingdom       WWW: