Re: [opensuse] SSH session not terminated when rebooting machine + startup question

2007-04-20 Thread Michael Letourneau
Petr Klíma wrote:
> Carlos E. R. wrote:
>> The original poster did not say that the shutdown command is issued from
>> the ssh session. That's an assumption made later by Harris.
>
> That's right, ssh session is not terminated in any case - I can submit
> reboot from other session or locally, nothing matters.
>
>> Look: open a terminal in you computer, and do "ssh localhost". Then,
>> shut
[snip]
>
> Well, my experience is when you work on remote machine using ssh and
> restart sshd daemon (sshd gets killed for sure), no ssh session is
> terminated and you can work almost without interruption. Obviously, Suse
> behaves exactly the same way when rebooting. BUT every other distro I
> ever used extensively (Debian, RH, Fedora) terminated ssh sessions
> correctly upon reboot.
>
This is not my experience at all, in fact quite the opposite.  On RHEL 2.1
and 3.0 I have used this "feature" to do updates to sshd_config and the
sshd binary itself.  Restarting the process and being able to verify the
configuration is working as expected without getting cut off with your
original session was a good thing in that case.  Having several dozen
machines and having to connect to the console remotely (through the RIB or
RSA) can be a pain in the butt.

Yes, of course you could just setup your own daemon running on a different
port and do the work from there, but since this feature existed it was
nice to use.

Michael

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] SSH session not terminated when rebooting machine + startup question

2007-04-20 Thread Petr Klíma
Carlos E. R. wrote:
> The original poster did not say that the shutdown command is issued from 
> the ssh session. That's an assumption made later by Harris.

That's right, ssh session is not terminated in any case - I can submit
reboot from other session or locally, nothing matters.

> Look: open a terminal in you computer, and do "ssh localhost". Then, shut 
> down the sshd daemon. I just did, and the client ssh is still running and 
> working! In fact, doing a "ps afx" shows that the sshd daemon did not die:
> 
> 16412 ?Ss 0:00 sshd: cer [priv]   
> 16414 ?S  0:00  \_ sshd: [EMAIL PROTECTED]/31 
>   
> 16415 pts/31   Ss+0:00  \_ -bash
> 
> And the log shows:
> 
>   Apr 19 23:18:07 nimrodel sshd[16409]: Server listening on :: port 22.
>   Apr 19 23:18:19 nimrodel sshd[16412]: Accepted publickey for cer from 
> 127.0.0.1 port 23422 ssh2
>   Apr 19 23:18:29 nimrodel sshd[16409]: Received signal 15; terminating.
> 
> but it hasn't terminated. During halt it will be forcibly killed later on 
> the sequence. I killed it via "killall sshd" and then the client died. I'm 
> not going to shutdown my computer to check, but as I recollect, I have 
> seen client sessions not dying.

Well, my experience is when you work on remote machine using ssh and
restart sshd daemon (sshd gets killed for sure), no ssh session is
terminated and you can work almost without interruption. Obviously, Suse
behaves exactly the same way when rebooting. BUT every other distro I
ever used extensively (Debian, RH, Fedora) terminated ssh sessions
correctly upon reboot.


Oh and I see that I forgot my second question before. It's related to
shutdown rather that to startup though.
I use OpenSuse 10.X with /home on NFS (not sure if it's significant...).
The problem is that sometimes reboot or shutdown doesn't proceed and
halts. Last message written on the console is "Sending processes the
KILL signal". System is not dead (NumLock responding), but doesn't
proceed with shutdown/reboot further.

This happens everytime (or almost everytime) I try to shutdown/reboot
from KDE or GDM or using "reboot" command.
On the contrary, shutdown/reboot succeeds everytime when a) pressing
Power button and letting ACPI do the trick or b) going to the console
(real text console - Ctrl+Alt+F1...) and hitting Ctrl+Alt+Delete...

I experienced such behaviour with all OpenSuse 10.x versions, on
different machines, both i386 and x86_64 platforms.

Thanks for suggestions.

Petr
-- 
Petr "Tosuja" Klíma
Mail: [EMAIL PROTECTED]
Web: www.tosuja.info
ICQ: 52057532



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] SSH session not terminated when rebooting machine + startup question

2007-04-19 Thread mourik jan
The original poster did not say that the shutdown command is issued from 
the ssh session. That's an assumption made later by Harris.

Right...

I got on too late.

Anyway, thanks for explaining the real problem.

regards,
mj
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] SSH session not terminated when rebooting machine + startup question

2007-04-19 Thread Carlos E. R.
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


The Thursday 2007-04-19 at 22:19 +0200, mourik jan heupink wrote:

> Isn't this whole issue related to the fact that when a process is still active
> in that ssh session (namely: the reboot command), the session 'hangs' when
> closing..? This is normal, isn't it?

The original poster did not say that the shutdown command is issued from 
the ssh session. That's an assumption made later by Harris.

Look: open a terminal in you computer, and do "ssh localhost". Then, shut 
down the sshd daemon. I just did, and the client ssh is still running and 
working! In fact, doing a "ps afx" shows that the sshd daemon did not die:

16412 ?Ss 0:00 sshd: cer [priv]   
16414 ?S  0:00  \_ sshd: [EMAIL PROTECTED]/31   

16415 pts/31   Ss+0:00  \_ -bash

And the log shows:

  Apr 19 23:18:07 nimrodel sshd[16409]: Server listening on :: port 22.
  Apr 19 23:18:19 nimrodel sshd[16412]: Accepted publickey for cer from 
127.0.0.1 port 23422 ssh2
  Apr 19 23:18:29 nimrodel sshd[16409]: Received signal 15; terminating.

but it hasn't terminated. During halt it will be forcibly killed later on 
the sequence. I killed it via "killall sshd" and then the client died. I'm 
not going to shutdown my computer to check, but as I recollect, I have 
seen client sessions not dying.

- -- 
Cheers,
   Carlos E. R.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Made with pgp4pine 1.76

iD8DBQFGJ+AAtTMYHG2NR9URApyIAJ9N+ND7sGiGK33RlNr1uZ9QajNb3wCfUJee
c/c1pu5aH/2IoMr6a1xxK48=
=aXVm
-END PGP SIGNATURE-

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] SSH session not terminated when rebooting machine + startup question

2007-04-19 Thread mourik jan heupink

Hi all,

Isn't this whole issue related to the fact that when a process is still 
active in that ssh session (namely: the reboot command), the session 
'hangs' when closing..? This is normal, isn't it?


Like this: "sleep 10 & exit" hangs the ssh session, it doesn't resturn 
the prompt.


Whereas "sleep 10 < /dev/null > /dev/null 2>&1 &" DOES work, does return 
the prompt.*

*
mourik jan*
*
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] SSH session not terminated when rebooting machine + startup question

2007-04-19 Thread Carlos E. R.
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


The Thursday 2007-04-19 at 14:27 -0500, M Harris wrote:

>   Its pretty normal, actually.
> 
>   ... what you want to do is to ssh to Boris and reboot the guy with this:
> 
>   su  -  -c  "shutdown -r +1"

It happens regardless of how you shutdown Boris; it might be some one else 
who is closing Boris.


> message...  or it will hang there for a long long long time.  Eventually it 
> will give up though and go away.   I think its really a tcp/ip thing.  :}

The problem is, that although the sshd daemon knows it is going down, and 
it knows perfectly well who is connected, it doesn't disconnect the 
clients before going down.

It shouldn't be the responsibility of the user to detect that the server 
is going down and disconnect. Computers are made to automate things.

So, unless there is an option in the sshd configuration to change this 
behavior, it is a bug or misfeature.

- -- 
Cheers,
   Carlos E. R.

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Made with pgp4pine 1.76

iD8DBQFGJ8xZtTMYHG2NR9URAn4JAJ9fu4liPUrkzdGn+ZGXeEQQYU7hvQCfdXpW
zXwrE1nKroXnqz4F2A1RJUY=
=YKaO
-END PGP SIGNATURE-

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] SSH session not terminated when rebooting machine + startup question

2007-04-19 Thread M Harris
On Thursday 19 April 2007 04:05, Petr Klíma wrote:
> Let's login using SSH from computer Anna to computer Boris. Restart
> Boris. SSH session on Anna is not correctly terminated and hangs on
> until I kill that specific ssh process.
Its pretty normal, actually.

... what you want to do is to ssh to Boris and reboot the guy with this:

su  -  -c  "shutdown -r +1"

Change the +1 to anything you want... in minutes.  This gives you a 
little 
more time to type "exit" and get back to Anna before Boris goes down.  If you 
are quick enough you can use:

su  -  -c  "shutdown -r now" 

... but, you must type  "exit"  immediately after you see the shutting 
down 
message...  or it will hang there for a long long long time.  Eventually it 
will give up though and go away.   I think its really a tcp/ip thing.  :}




-- 
Kind regards,

M Harris <><
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] SSH session not terminated when rebooting machine + startup question

2007-04-19 Thread Carlos E. R.
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


The Thursday 2007-04-19 at 11:05 +0200, Petr Klíma wrote:

> with OpenSuse 10.2 (but the same misfeature is present in an old 8.2)
> I've got this annoying behaviour:
> 
> Let's login using SSH from computer Anna to computer Boris. Restart
> Boris. SSH session on Anna is not correctly terminated and hangs on
> until I kill that specific ssh process.

I think that if you leave it on for suficient time it finally gives up 
(timeout somewhere) and closes.

> 
> I haven't investigated it in depth, but I suspect init scripts, more
> specifically ssh server being shut down after bringing down network
> interfaces.

No, not so. In my system:

/etc/init.d/rc3.d/K17sshd
/etc/init.d/rc3.d/K21network

ie, the sshd daemon goe down first.


> Does anoyone else suffer from the same "feature"? Is it worth submitting
> as a bug?

Yes, I have seen it before. Maybe it is a "feature". Maybe we have to 
modify something so taht the server inform the client that he is going 
down. Dunno. I'd have to read the manual again, but I have a slight 
headache...

- -- 
Cheers,
   Carlos E. R.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Made with pgp4pine 1.76

iD8DBQFGJ7xftTMYHG2NR9URAo7nAKCPxMlRYQDqCIKVrmz9M7vw+UpPJACeOdRn
fwBRNlyml79/buqRuhm028A=
=AA3V
-END PGP SIGNATURE-


Re: [opensuse] SSH session not terminated when rebooting machine + startup question

2007-04-19 Thread John Andersen
On Thursday 19 April 2007, Petr Klíma wrote:
> I haven't investigated it in depth, but I suspect init scripts, more
> specifically ssh server being shut down after bringing down network
> interfaces.
>
> Does anoyone else suffer from the same "feature"? Is it worth submitting
> as a bug?

The ssh server in Anna is not involved in an ssh session initiated from
anna to boris.  Its just a command line program.

But to answer your question, yes I see this occasionally, and I learn
to close the window immediately after i tell boris to reboot.

Its a tcp thing I think.  Anna is still believing there is a chance
boris will come back, but he's run off somewhere.

-- 
_
John Andersen
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]