From owner-freebsd-questions Wed Jan 7 11:22:54 1998 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id LAA00576 for questions-outgoing; Wed, 7 Jan 1998 11:22:54 -0800 (PST) (envelope-from owner-freebsd-questions) Received: from havea.min.net (root@havea.min.net [208.222.210.18]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id LAA00544 for ; Wed, 7 Jan 1998 11:22:38 -0800 (PST) (envelope-from aling@alum.mit.edu) Received: from localhost (outpost.cc.nih.gov [137.187.245.138]) by havea.min.net (8.8.7/8.7.3) with SMTP id OAA17067 for ; Wed, 7 Jan 1998 14:22:24 -0500 (EST) Message-Id: <199801071922.OAA17067@havea.min.net> From: "A. Ling" To: "FreeBSD-questions" Date: Wed, 07 Jan 98 14:22:23 -0400 Reply-To: "A. Ling" Priority: Normal X-Mailer: Alexander Ling's Registered PMMail 1.53 For OS/2 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: Proper shutdown method? (was: /etc/shutdown.d not in bsd) Sender: owner-freebsd-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk As a newbie, I'd just like to clarify. I've been doing what the tutorial (http://www.freebsd.org/tutorials/newuser/newuser.html) talks about: To shut down the machine type: # /sbin/shutdown -h now Or to reboot type # /sbin/shutdown -r now Now man shutdown(8) says in part: Available friendlinesses: -h The system is halted at the specified time when shutdown execs halt(8). So if shutdown -r just warns other users before eventually exec'ing halt, and if as Leif says halt doesn't signal init, it would seem that /etc/rc.shutdown is at least not guaranteed to run, or maybe never is run, and the proper way to to an orderly shutdown is to send some signal to init. Is this what he's saying he's modified his system to do? And if so, what command to 2.2.5R (I'm going to upgrade) sends the proper signal? Does it explain a symptom I've been noticing under 2.2.2R where I sometimes, but not always see a message in bright text something like "Syncing disks 3 2 Done \n Press any key to reboot"? -- when it doesnt type this, I've waited up to 30 minutes more without any further text printing, or hearing disk activity. The next boot almost never gives fsck error messages. Thanks for any enlightenment. ------------- Earlier message fragment: -------------- From: leifn@image.dk (Leif Neland) Date: 07 Jan 98 13:01:48 +0100 Subject: Re: /etc/shutdown.d not in bsd At 05 Jan 98 08:13:58 Joel Ray Holveck wrote regarding Re: /etc/shutdown.d not in bsd >>> Being used to /etc/shutdown.d in SysV, I can't understand BSD can >>> do without it. >> Because the system will shut them down for you. When the system is >> halted, every process is sent a SIGTERM (signal 15). most >> processes will then exit gracefully. (Some evil ones that mask >> SIGTERM then get a SIGKILL to finish them off). JR> He means to ensure that, for instance, a process which dies with JR> runtime summaries is killed before syslogd; a client which send a JR> shutdown message to its server is killed before PPP, etc. JR> JR> This is done by /etc/rc.shutdown, as mentioned in init(8). But here comes the nasty thing: halt/reboot does NOT signal init, so init doesn't get a chance to execute /etc/rc.shutdown. halt/reboot just kills everything in sight itself. When doint kill -INT 1 or kill -TERM 1, init runs /etc/rc.shutdown, and reboots or goes into singleuser mode. ------------ end of fragment ------------