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.

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.

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

@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?

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

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.

@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