“shutdown now” never shut it down (i.e. powered off)

Forum Forums New users New Users and General Questions “shutdown now” never shut it down (i.e. powered off)

Tagged: 

  • This topic has 8 replies, 5 voices, and was last updated Jul 26-10:22 pm by Brian Masinick.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #63590
    Member
    Bajingan

      shutdown now never really shut it down. Instead, it prompts to ask root password to do maintenance routine of something, or doing nothing with blinking cursor in Linux prompt.

      If I press Ctrl+D, it would start the OS up.

      #63591
      Moderator
      christophe
        Helpful
        Up
        0
        ::

        I don’t see a question here — but I think you are looking for the command to shut down?

        sudo poweroff

        shuts you down from command line without asking for password.

        EDIT:

        or using the shutdown command, as you did:

        sudo shutdown -h now

        does shut down & halt the computer, after entering password.

        Let us know if I missed what you were asking. 😉

        • This reply was modified 1 year, 9 months ago by christophe. Reason: added shutdown command part

        confirmed antiX frugaler, since 2019

        #63596
        Moderator
        Brian Masinick
          Helpful
          Up
          0
          ::

          I usually say either

          Sudo halt

          Or

          sudo power off

          If I type something; otherwise I use the window manager or desktop environment to halt the system.

          --
          Brian Masinick

          #63603
          Member
          Bajingan
            Helpful
            Up
            0
            ::

            But, what I don’t understand is why shutdown now behaves like that?

            After stopping the services, then ask a root password or press Ctrl+D to continue.

            #63605
            Member
            seaken64
              Helpful
              Up
              0
              ::

              the shutdown command has a lot of switches/arguments. Did you read the man page for shutdown for clues as to what the different switches do?

              Seaken64

              #63606
              Member
              seaken64
                Helpful
                Up
                0
                ::

                My guess is that this is the behavior if you are not root or do not proceed the command with sudo.

                Seaken64

                #63610
                Member
                blur13
                  Helpful
                  Up
                  0
                  ::

                  You need to use the -h option to get the shutdown behavior you’d expect coming from windows. Took some time to figure that out for me as well.

                  #63682
                  Moderator
                  Brian Masinick
                    Helpful
                    Up
                    0
                    ::

                    I still recommend simply typing in the command you want, for instance, sudo reboot, sudo halt, or sudo poweroff.

                    However, if you INSIST to do it another way (and it was recommended that you read the shutdown man page; well, here it is:

                    man shutdown:

                    SHUTDOWN(8)                        shutdown                        SHUTDOWN(8)
                    
                    NAME
                           shutdown - Halt, power-off or reboot the machine
                    
                    SYNOPSIS
                           shutdown [OPTIONS...] [TIME] [WALL...]
                    
                    DESCRIPTION
                           shutdown may be used to halt, power-off or reboot the machine.
                    
                           The first argument may be a time string (which is usually "now").
                           Optionally, this may be followed by a wall message to be sent to all
                           logged-in users before going down.
                    
                           The time string may either be in the format "hh:mm" for hour/minutes
                           specifying the time to execute the shutdown at, specified in 24h clock
                           format. Alternatively it may be in the syntax "+m" referring to the
                           specified number of minutes m from now.  "now" is an alias for "+0",
                           i.e. for triggering an immediate shutdown. If no time argument is
                           specified, "+1" is implied.
                    
                           Note that to specify a wall message you must specify a time argument,    
                           too.
                                                                                                    
                           If the time argument is used, 5 minutes before the system goes down the
                           /run/nologin file is created to ensure that further logins shall not be
                           allowed.
                                                                                                    
                    OPTIONS
                           The following options are understood:
                                                                                                    
                           --help
                               Print a short help text and exit.                                    
                                                                                                    
                           -H, --halt                                                               
                               Halt the machine.
                                                                                                    
                           -P, --poweroff                                                           
                               Power-off the machine (the default).                                 
                                                                                                    
                           -r, --reboot
                    
                           -h
                               Equivalent to --poweroff, unless --halt is specified.
                    
                           -k
                               Do not halt, power-off, reboot, just write wall message.
                    
                           --no-wall
                               Do not send wall message before halt, power-off, reboot.
                    
                           -c
                               Cancel a pending shutdown. This may be used to cancel the effect of
                     EXIT STATUS
                           On success, 0 is returned, a non-zero failure code otherwise.
                    
                    SEE ALSO
                           systemd(1), systemctl(1), halt(8), wall(1)
                    
                    systemd 247                                                        SHUTDOWN(8)
                              an invocation of shutdown with a time argument that is not "+0" or
                               "now".
                    • This reply was modified 1 year, 9 months ago by Brian Masinick.

                    --
                    Brian Masinick

                    #63687
                    Moderator
                    Brian Masinick
                      Helpful
                      Up
                      0
                      ::

                      I got that from a different system; we don’t DO systemd here; that one came from the siduction 2021 C-Blues man page, sorry!

                      --
                      Brian Masinick

                    Viewing 9 posts - 1 through 9 (of 9 total)
                    • You must be logged in to reply to this topic.