Should 'halt' call 'shutdown'?

Filed under
Linux

As mentioned briefly in the comments section of Bootstrapping your Linux Machine, recent Linux systems have added a convenience feature to the 'halt' and 'reboot' commands: they actually call 'shutdown' if the system isn't in init state 0 or 6.

You can override this behaviour with "-f" or use 'poweroff', but I'm not entirely sure that this was a good idea to start with.
The purpose of 'shutdown' is to bring the system down cleanly. It should kill off user processes gently (starting with SIGTERM so that processes that trap that can clean up open files, etc.) and it should then have 'init' change run levels so that appropriate scripts can run to do other cleanup.

This is all to the good. It's the way a system should be brought down under normal circumstances, so having 'halt' and 'reboot' invoke 'shutdown' is certainly helpful for the naive user who doesn't understand what should be done to bring down a system. But should traditional commands be perverted to prevent naive users from damaging systems?

Full Article.