From owner-freebsd-questions Wed Aug 18 20:56:59 1999 Delivered-To: freebsd-questions@freebsd.org Received: from inet.chip-web.com (c1003518-a.plstn1.sfba.home.com [24.1.82.47]) by hub.freebsd.org (Postfix) with SMTP id 8EBC914BD3 for ; Wed, 18 Aug 1999 20:56:55 -0700 (PDT) (envelope-from ludwigp@bigfoot.com) Received: (qmail 17725 invoked from network); 19 Aug 1999 03:57:11 -0000 Received: from speedy.chip-web.com (HELO speedy) (172.16.1.1) by inet.chip-web.com with SMTP; 19 Aug 1999 03:57:11 -0000 Message-Id: <4.2.0.58.19990818194025.0098b430@toy> X-Sender: ludwigp@toy (Unverified) X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58 Date: Wed, 18 Aug 1999 20:55:41 -0700 To: Gary Kline From: Ludwig Pummer Subject: Re: "shutdown -h now" risk? Cc: Christopher Michaels , questions@FreeBSD.ORG In-Reply-To: <19990818181702.A3248@athena.tera.com> References: <4.2.0.58.19990818161828.00bdc8e0@toy> <6C37EE640B78D2118D2F00A0C90FCB4401105BA8@site2s1> <4.2.0.58.19990818161828.00bdc8e0@toy> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG At 06:17 PM 8/18/1999 -0700, Gary Kline wrote: >On Wed, Aug 18, 1999 at 04:19:50PM -0700, Ludwig Pummer wrote: > > At 06:35 PM 8/18/1999 -0400, Christopher Michaels wrote: > > >Can someone explain to me why a "shutdown -r now" would be dangerous? > > >-Chris > > > > It's not. > > > > Longer answer: > > It pops down to single user mode (killing running daemons in the process), > > syncs the disks, and umounts the filesystems. Those last 2 are the > > important ones. > > > ``shutdown -r now'' does a shutdown and reboot immediately. > It's ``shutdown now'' that lowers the system from multi-user > to single-user. To clarify that "shutdown and reboot immediately": it does first do all that stuff I mentioned above (except going to single user mode). Although I'm no longer so sure about the umounting of the disks. There's no mention of that in either reboot.c or shutdown.c, but it may be in the reboot() system call. In any case, fsck doesn't complain when you reboot after one of the shutdown commands mentioned above. Yes, you're right. It doesn't go to single user mode. I was mistakenly associating that with killing all of the other processes. Looking through the shutdown.c source, I see that 'shutdown -r' just calls 'reboot -l' and 'shutdown -h' just calls 'halt -l' (and reboot and halt are just hardlinks to the same program). Reboot does do all of the nice killing processes and syncing disks, though. --Ludwig Pummer To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message