[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: putty logout hang

> -----Original Message-----
> From: Brooks R. Robinson [mailto:brooks.robinson@rides.com]
> Sent: Monday, December 16, 2002 2:39 PM
> To: debian
> Subject: RE: putty logout hang
> | Hi,
> | Whenever I login to my woody server and run a command
> | and place it in the background, I can't logout from the putty
> | window properly.
> | For example:
> | I'll use putty (ssh), login and run an rsync command over the network.
> | (This command may take 10 minutes)
> | So I ^Z it, and then bg it to the background.
> | I then use the exit command and I logout but the putty window hangs.
> |
> | If I don't have background commands running everything is fine.
> |
> | Anyone else have this problem?
> | Its not really a big deal, just wondering if this is putty
> thing or what.
> |
> | Thanks
> | Mike
> I think that it's an (ba)sh/ssh(d)/init thing.  When you kill off the
> connection, your child processes should chain up so that eventually init
> should adopt them and take care of them until they die.  However, I don't
> think that ssh(d) is doing it's job and orphaning them for init
> to adopt.  I
> haven't tried any other windows ssh clients to see if this is true or not.
> Otherwise putty isn't making a clean connection as other have said.
> HTH,
> Brooks

I believe this behavior is intentional.

Using ssh under solaris exhibits the same behavior. I don't entirely know
the reason but I'll take a wild guess and say that as long as the child
process is attached to a tty, ssh won't let go of the parent. I suspect if
you can make the child process both disown itself and detach from the tty,
you should be set.

Something like this might work (bash, sh)

ls < /dev/null >/dev/null 2>&1

but I'm not sure. ttys are a bit on the black magic side.

Installing and using screen, as someone suggested, also works. I hate screen
though since it interferes with my emacs keybindings and I'm too lazy to
reconfigure yet another program.

Reply to: