Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Aug 1999 20:55:41 -0700
From:      Ludwig Pummer <ludwigp@bigfoot.com>
To:        Gary Kline <kline@tera.com>
Cc:        Christopher Michaels <ChrisMic@clientlogic.com>, questions@FreeBSD.ORG
Subject:   Re: "shutdown -h now" risk?
Message-ID:  <4.2.0.58.19990818194025.0098b430@toy>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <ludwigp@bigfoot.com>


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?4.2.0.58.19990818194025.0098b430>