You are not logged in.

#1 2012-06-07 23:27:06

JackH79
Member
From: Australia
Registered: 2009-06-18
Posts: 663
Website

Clarification? "init 0" vs. "shutdown"

I've just looked at the manpages of init and shutdown and was wondering what the advantage is of using

shutdown -h now

over

init 0

Since I'm a natural born slacker, I would prefer to just type 'init 0', but I'm wondering about any hidden ramifications. Would I be getting into a bad habit?

If I look at /etc/inittab, it calls /etc/rc.shutdown to shut down nicely.

According to its manpage, init is using /etc/inittab.

According to shutdown's manpages, it calls init to shut down.

So there is a sort of cascade going from shutdown > init > inittab > rc.shutdown > etc ...

Now, shutdown apparently creates certain files (ie /etc/nologin) when called. From what I see, init does not do this.

Questions are:
1.: Did I understand the essence of it?
2.: What is the advantage of using "shutdown" over "init" on a single user system? I can see the /etc/nologin being of advantage in a multi-user / remote-user setting.

Thanks.

Offline

#2 2012-06-07 23:40:02

ratcheer
Member
Registered: 2011-10-09
Posts: 912

Re: Clarification? "init 0" vs. "shutdown"

init 0 powers down the system, so it is analogous to "shutdown -P now". shutdown -h only halts the system.

Personally, as a longtime UNIX user, I generally use init 0, or init 6 to reboot. I have never noticed any harmful effects.

Tim

Last edited by ratcheer (2012-06-07 23:41:43)

Offline

Board footer

Powered by FluxBB