LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   shutdown query (https://www.linuxquestions.org/questions/linux-newbie-8/shutdown-query-673262/)

ritam_bkp 09-30-2008 06:16 AM

shutdown query
 
hello friends
yesterday i read a book named LINUX COMMAND REFERENCE by pffafenberger published by sybex international.

"Shutdown command should be used when you are logged out of the Xsession"
----i found this statement while going through that book

What i wish to know is......does this makes any difference to a proper shutdowning whether or not i am in the Xsession???
i have also googled a lot abt this....but nobody has mentioned abt the significance or insignificance of the Xsesion for the shutdown command..
looking forward 4 ur suggestions to clear my confusion.
thank u

pinniped 09-30-2008 06:43 AM

What a strange statement. 'shutdown' will switch the system to runlevel 0 (stop) or runlevel 6 (reboot) depending on the arguments. An xsession will not interfere at all with shutdown doing its job. Going back over a decade and onto UNIX systems, you could have maybe 40 or more people connected to a mainframe and all using X - so there you've got 40 X sessions. Now the admin logs onto X as a normal user, runs 'su' (or whatever mechanism that UNIX had - 'wheel' group or whatever), fiddles around with the system, then invokes shutdown with, say, a 5 minute wait and messages broadcast to users every 30 seconds. The admin then logs out and goes for a cup of coffee. The users don't necessarily log out; maybe they were talking to someone or ran off to grab a coffee too - the system boots them all off and shuts down (or restarts) anyway. It would be outright stupid to require all X sessions to be closed first - how can you possibly do that when anyone can log in from any terminal in the building/campus/planet?

Now when the system is shutting down, SIGINT will be broadcast to all running applications. Applications should respond by saving any work and closing in a sensible way. Of course applications that don't handle SIGINT simply die. After some set amount of time, SIGKILL is sent to any processes which are still running. 'init' is now the sole process running and it continues to go through its list of things to do to shut down (sync HDs, unmount filesystems, unload modules, park HD heads, switch off computer).

ritam_bkp 09-30-2008 06:56 AM

thanx a lot...
that was a lot of help...
i guess when we click on the shutdown button it runs the shutdown -h now command and it is ofcourse in the Xsesion...so i think the author might have mesed up in this matter
:)
thanx once again


All times are GMT -5. The time now is 03:58 AM.