Results 1 to 7 of 7

Thread: Hangs on SSH logout

  1. #1

    Default Hangs on SSH logout

    I've been using OpenSUSE (11.2) and ssh to access my Ubuntu Server (8.04). The problem is that when I give the shutdown command to turn off the server (sudo shutdown -P now), OpenSUSE hangs and I can't close bash and the computer locks up. I then need to turn my OpenSUSE box off by pushing the power button. Any idea what might be causig this?

    I'm not sure if this is the right place to ask this question because I don't think this is a bash problem but I wasn't really sure where to ask this question.

  2. #2
    Join Date
    Jun 2008
    Location
    The English Lake District. UK - GMT/BST
    Posts
    36,734
    Blog Entries
    20

    Default Re: Hangs on SSH logout

    The strange thing about this question to me is:
    How often do you shut down the server.
    You say ssh. Is that just ssh or ssh -X
    And you can unmount ssh connections.

    But I never have any trouble with this.
    Leap 15.1_KDE
    My Articles Was I any help? If yes: Click the star below

  3. #3
    Chill Out NNTP User

    Default Re: Hangs on SSH logout

    On Wed, 05 May 2010 04:36:01 +0000, markf2 wrote for a reply:

    > I've been using OpenSUSE (11.2) and ssh to access my Ubuntu Server
    > (8.04). The problem is that when I give the shutdown command to turn off
    > the server (sudo shutdown -P now), OpenSUSE hangs and I can't close bash
    > and the computer locks up. I then need to turn my OpenSUSE box off by
    > pushing the power button. Any idea what might be causig this?
    >
    > I'm not sure if this is the right place to ask this question because I
    > don't think this is a bash problem but I wasn't really sure where to ask
    > this question.


    Assuming you are really on the server have you tried?

    Code:
    =============
    shutdown -P now +3
    exit
    =============



    --
    Chillingout@opensuse.forum

  4. #4

    Default Re: Hangs on SSH logout

    @caf4926
    I'm using bash to log in to Ubuntu Server. I don't run X on my Ubuntu Server so it's straight command line. I log in using ssh syntax (ssh ip address -l username -p port). I shut down the server if I'm away for the weekend, which is often lately, and only because I know I won't use it or access it. I know - shutting down is a Linux no-no...

    @Chill Out
    I'm really on the server. If I use bash, type the ssh command to log in to the server, aren't I on the server? I can mount and unmount partitions on the server and update the server so I assume I'm on it. I tried your suggestion but the result was the same. I can hit CTRL-ALT-DEL and get the shutdown screen. This results in a proper, albeit very slow, shutdown.


    Any other ideas?

  5. #5
    Join Date
    Jul 2008
    Location
    Seattle, WA
    Posts
    17,079

    Default Re: Hangs on SSH logout

    On Thu, 06 May 2010 06:06:01 +0000, markf2 wrote:

    > @caf4926
    > I'm using bash to log in to Ubuntu Server. I don't run X on my Ubuntu
    > Server so it's straight command line. I log in using ssh syntax (ssh ip
    > address -l username -p port). I shut down the server if I'm away for the
    > weekend, which is often lately, and only because I know I won't use it
    > or access it. I know - shutting down is a Linux no-no...
    >
    > @Chill Out
    > I'm really on the server. If I use bash, type the ssh command to log in
    > to the server, aren't I on the server? I can mount and unmount
    > partitions on the server and update the server so I assume I'm on it. I
    > tried your suggestion but the result was the same. I can hit
    > CTRL-ALT-DEL and get the shutdown screen. This results in a proper,
    > albeit very slow, shutdown.
    >
    >
    > Any other ideas?


    If it locks up, try pressing CTRL+C (I sometimes have to do this if I
    have used port forwarding for some reason). If that doesn't work, try
    hitting Enter, then press the ~ key and then press "." (no quotes). That
    will terminate the ssh connection.

    Jim



    --
    Jim Henderson
    openSUSE Forums Administrator

  6. #6
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: Hangs on SSH logout

    Here's what I do when I want to shutdown a server over ssh:

    shutdown -fr now < /dev/null > /dev/null 2>&1 &

    This ensures that none of the ssh session's file descriptors are held by shutdown and I can exit without interrupting shutdown.

  7. #7

    Default Re: Hangs on SSH logout

    @caf4926, Chill Out, hendersj, ken_yap

    Thanks for all of the suggestions. I've been inordinately busy (got a job) so I haven't had an opportunity to try all of your suggestions but I wanted to thank you all for the help.

    Mark

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •