Subject: Action of halt/reboot from scripts
To: None <current-users@NetBSD.ORG>
From: Stephen Borrill <sborrill@xemplar.co.uk>
List: current-users
Date: 02/12/1998 14:20:48
Can I check the expected behaviour of calling halt/reboot from shell
scripts or CGI scripts?

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).

Is this correct behaviour and if so is there a workaround?
I'm using NetBSD/arm32.

-- 
Stephen Borrill,
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: http://www.xemplar.co.uk/