Announcement

Collapse
No announcement yet.

Sudo halt vs. GUI

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Sudo halt vs. GUI

    I stuck this post here, because I don't know where to put it.
    It's probably one of those posts that i will get no answer to...
    I recently installed Yakuake (which is the best app ever) and I wondered what can it be done with it, so
    I learned how to start a program:
    Code:
    firefox &
    or how to reboot:
    Code:
    sudo reboot
    But didn't knew how to turn off my computer, but recently i learned that this is done with:
    Code:
    sudo halt
    The interesting thing that I noticed was that my computer shut downs "better" then through GUI.
    When i press shutdown button on log out screen i first get cryptic CLI messages about knetwork manager failing (I had this ever since upgrading to KDE4 and i think it's not a bug), then it goes to splash screen an then it shuts down. But sometimes the shut down is not so smooth. Sometimes my computer dosen't want to shut down completely. It does "shut down" it's just that fan in power supply is still working and the light that is indicating that computer is running is still on.
    I did send it to servis they did some test found out nothing is wrong but still put a new power supply in it. But things were still the same. And not to forget this was all when I was still using Windows so Linux kernel or Kubuntu didn't brake it was already broken...
    It actually became very rare in Kubuntu as oppose to Windows where this was an regular problem.
    But what I noticed was that somehow
    Code:
    sudo halt
    works better for me, without any Failed messages in CLI or anything like that it proceeds directly to splash and even this is faster as it would be if I would press the shut down button in GUI.

    The question is how IS this POSSIBLE? I thought that sudo halt is just backend for GUI frontend, it can't be that different...

    And if I at it does anyone knows how to logout from current session from CLI like Yakuake?
    I tried logout but it doesn't work...

    (I'm very sorry for this totally irrelevant post)
    I'm magnet for errors, problems and bugs...

    #2
    Re: Sudo halt vs. GUI

    The preferred CLI shutdown command is "shutdown".

    Code:
    man shutdown
    to learn its options. To shutdown as quickly as possible:

    Code:
    sudo shutdown now
    To shutdown quickly and then reboot:

    Code:
    sudo shutdown now -r
    "halt" is an ancient command from Unix -- it is the CLI version of pulling the power cord out of the wall. I don't think it provides any "graceful" file- or session-closing services for you. Check the "Notes" here.

    Comment


      #3
      Re: Sudo halt vs. GUI

      Oh that explains a lot. Because halt really fells like puling the power cord...
      I'm magnet for errors, problems and bugs...

      Comment


        #4
        Re: Sudo halt vs. GUI

        Originally posted by dibl
        "halt" is an ancient command from Unix -- it is the CLI version of pulling the power cord out of the wall. I don't think it provides any "graceful" file- or session-closing services for you. Check the "Notes" here.
        /sbin/halt and /sbin/poweroff are on (my) kubuntu machine symlinks to /sbin/reboot which calls /sbin/shutdown with proper arguments. So halt usage should be 'safe' (using the -f option may be an exception...'man halt' for details)

        I concur with the basic concept that the GUI shutdown probably tries to close the KDE/X-session (ksmserver) more 'gracefully' than the CLI method, so there probably are differences in the process.

        Comment


          #5
          Re: Sudo halt vs. GUI

          Well I tried
          Code:
          sudo shutdown now
          It didn't worked my computer got stuck in "splash" screen for about 5 minutes then I decided to do the "halt" process manually so I reset it and turned it off.
          I have no idea why would this be a problem... I'll try some other approach to see the result, but for now
          sudo halt works best for me.
          I'm magnet for errors, problems and bugs...

          Comment


            #6
            Re: Sudo halt vs. GUI

            @primoz, if you do a normal shutdown, let it hang, then reboot with a Live CD, you could read the /var/log logs and maybe learn what is keeping it from shutting all the way down. I vaguely recall hearing of ACPI-related things that can cause that problem.

            @kubicle -- thanks, I didn't know that! If there were no symlinks to /sbin/reboot (and thereby to /sbin/shutdown), then my understanding is that the old "halt" command by itself merely stops the CPU clock, and you're done, just as if power were removed. No file closing or filesystem journal-writing, which is important to do prior to "turning it off".

            Comment


              #7
              Re: Sudo halt vs. GUI

              @ dibl: I'll try this on next system shutdown hang...

              Also I learned why my system hanged with CLI command;
              It's not sudo shutdown now but rather:
              Code:
              sudo shutdown -h now
              h I think it's for halt.... anyway it works fine...
              I'm magnet for errors, problems and bugs...

              Comment

              Working...
              X