Difference between menu shutdown and 'shutdown -h now'

19,926

Solution 1

The shutdown menu item requests the graphical system to shutdown cleanly. Programs that have files to save, for example, have an opportunity to ask the user what to do.

shutdown -h now (synonym: poweroff; see also reboot) merely sends signals to all running programs. They don't have a chance to query the user if they have unsaved files. However, sending the poweroff command will work in more situations because of this.

Solution 2

The menu calls a complicated set of freedesktop.org specifications that shut down the system without the user needing to be root. You can see some of these on this answer. This method checks for open documents and blocking applications in the graphical interface before eventually calling for a system halt (via shutdown).

Running shutdown directly just shuts the computer down - regardless of what's running.

If the first isn't working, there's probably something blocking it. I'm not an expert in how it works so I suggest you file a bug on LaunchPad and let somebody who does know how it works step you through the debug process.

Share:
19,926

Related videos on Youtube

719016
Author by

719016

Updated on September 18, 2022

Comments

  • 719016
    719016 almost 2 years

    What is the difference between the shutdown menu item and shutdown -h now? The former sometimes hangs up my laptop on Ubuntu 11.10.

  • Scott Severance
    Scott Severance over 12 years
    This doesn't answer the question.
  • 719016
    719016 over 12 years
    Thanks very much. I didn't know about the difference in saving of files for open programs, it now makes sense to me.
  • trogne
    trogne almost 7 years
    @Scott Severance - You say it's a synonym, but then you say "poweroff command will work in more situations because of this". But because of what ? With poweroff, does programs will have a chance to query the user?
  • Lightness Races in Orbit
    Lightness Races in Orbit over 6 years
    What does shutting down cleanly involve if not sending signals to all running programs?
  • Scott Severance
    Scott Severance over 6 years
    With CLI commands, graphical programs have no opportunity to query the user about saving open files, for example. So there really are two different types of clean shutdowns.