shutdown on BSD and Linux
Bill Hacker
wbh at conducive.org
Thu Sep 7 04:09:16 PDT 2006
Rahul Siddharthan wrote:
I've long had a question on the shutdown process. Linux systems run a
separate shutdown script for every process that was started at boot,
and can take a minute or two to shutdown. FreeBSD and Dragonfly, as
far as I can tell, just kill all processes, flush buffers, unmount
filesystems and shutdown/poweroff, which takes about 5 seconds.
It may be faster on *BSD, but no more 'rude', at least with shutdown <now>.
Each process is asked politely to terminate - per the information in ~/etc/rc
and ~/etc/rc.d
Only if they dally do they get a firmer reproach.
Init 6 is *slightly* less forgiving, it goes directly to *dammit, I mean NOW*
mode. No daemon I have run in the last 6+ years was ever bothered by that.
OTOH, we use softupdates, RAID1, and forced '-y' not 'p' fscking at boot-time...
So what's up? Is BSD-style shutdown dangerous,
- not in the least!
or are the Linux
people stupid?
Surely you didn't even need to *ask* that in the face of massive evidence?
More 'gently' - *BSD has always been far more coherent, hence more efficient at
managing resources. It is also less frequently asked to do dumb
Microsoftish-things than Linux.
The question came to my mind again when I saw Ubuntu's specification
for shutdown in their future versions:
https://wiki.ubuntu.com/Teardown
Basically, it says the majority of init scripts needn't be called at
shutdown because the processes can just be sent signals and trusted to
do the right thing. However, some controlled shutdowns *do* need to
be done. Why can the BSDs get away with not doing these controlled
shutdowns?
Because the *BSD's are complete *Operating Systems* - with a very long history
of refinement as well as imrovement.
Linux is not an Operatign System, and has a shorter, and spottier, history - one
with far less strictness in QC.
Linux is a 'kernel', hooked - more or less successfully - to a diverse
collection of 'GNU' kit that makes it possible to *emulate* an operating system.
Thus the 300+ 'distros' out there in Penguin-land.
A *BSD variant is NOT a 'distro'. It is developed and tested as a whole-cloth
exercise. Th core components are know in advance, and tested together.
Think of *BSD as the refined 'whole system' characteristic of a Mercedes - auto
or truck. Linux, by comparison, is any of a brazillion varieties of
garage-built hot-rod - motorcycle to 'bigfoot' pickup truck - kitted together
out of whatever bits of kit the 'distro' packagers happens to hold in high
regard. Obviously, some 'garages' are bigger, better funded, and more competant
than others.
That doesn't mean you can't put together a very good Linux, managed by an expert
operator. It DOES mean that there is an element of chance.
Distro's aside, Linux' Kernel is nothing to write home about, either, so it is
starting off handicapped.
But it is free and available, and 'has lots of drivers...' so...
BTW - the poweroff on my laptop, with Dragonfly and FreeBSD (last I
checked), is also accompanied by a rather alarming and short-lived
whine, as if a spinning disk or fan was suddenly stopped. I don't get
this sound with linux or windows.
Rahul
Sounds more like a CPU-fan or HDD spun UP, not down, as needed in a burst of
intensive activity (putting stuff away properly before shutdown..)
Bill
More information about the Users
mailing list