Date: Thu, 19 Aug 1999 09:56:02 +0300 From: Ruslan Ermilov <ru@ucb.crimea.ua> To: Ludwig Pummer <ludwigp@bigfoot.com> Cc: Gary Kline <kline@tera.com>, Christopher Michaels <ChrisMic@clientlogic.com>, questions@FreeBSD.ORG Subject: Re: "shutdown -h now" risk? Message-ID: <19990819095602.C27684@relay.ucb.crimea.ua> In-Reply-To: <4.2.0.58.19990818194025.0098b430@toy>; from Ludwig Pummer on Wed, Aug 18, 1999 at 08:55:41PM -0700 References: <4.2.0.58.19990818161828.00bdc8e0@toy> <6C37EE640B78D2118D2F00A0C90FCB4401105BA8@site2s1> <4.2.0.58.19990818161828.00bdc8e0@toy> <19990818181702.A3248@athena.tera.com> <4.2.0.58.19990818194025.0098b430@toy>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Aug 18, 1999 at 08:55:41PM -0700, Ludwig Pummer wrote: > 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. > Exactly, look into /sys/kern/kern_shutdown.c. Syscall reboot() calls boot(), which then calls vfs_unmountall(). > 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. > Try looking into the most recent RELENG_3 or HEAD sources. -- Ruslan Ermilov Sysadmin and DBA of the ru@ucb.crimea.ua United Commercial Bank, ru@FreeBSD.org FreeBSD committer, +380.652.247.647 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990819095602.C27684>