PDA

View Full Version : SSH logout hangs


cooper
23-03-2005, 18:30
I have been experiencing this issue for some time now, and it hasnt really been a problem. But, I have some free time now so I thought I would share it and see if anyone else is experiencing it.

I am running 1.1a6 on gentoo with the following
2.6.2 kernel
OpenSSH 3.6.1p2
MySQL 4.0.16
PHP 4.3.10
Apache/2.0.52

I access this box via ssh using putty for windows. If I ssh into the box and start any of the zabbix processes (server, sucker, trapper, agentd) when I logoff of ssh, the session hangs. It logs me out, but somthing is hanging it up, and putty doesnt close. If I ssh into the same box and do other things, when i logoff, no problems, clean exit. Its only if one of the zabbix processess gets started during a shell session.

I have had this issue with 1.0 stable, and all of the 1.1 alphas I have used (about 4 of the 7). Anyone else experiencing anything similar? Or, do you have any thoughts as to why this might be happening?

Thanks,

cooper

rickardp
01-04-2005, 09:54
If you start something that binds to the pty, ssh will not release the terminal. I remember that there is a way to make a program disconnect from the pty where it was started. This is really not a zabbix problem (although it's annoying)

Alexei
01-04-2005, 13:42
All ZABBIX daemon processes do disconnect from standard output streams (stdout, stderr).

James Wells
22-06-2005, 20:22
Greetings,

Just running into this same issue. I decided to look through the source code and I see the problem, below is line 184 in zabbix_agentd.c, function daemon_init
for(i=0;i<MAXFD;i++)
{
/* Do not close stderr */
if(i != fileno(stderr)) close(i);
}


I could be mistaken, but reading through the code a bit more, I believe this is the culprit. We never actually close stderr, which means we never disassociate from the PTY, hence sshe will fail to break the connection.

Looking through the code a bit further, it appears that we only write to stderr one time after this is executed, and that is within the same function starting on line 194;
#ifdef HAVE_SYS_RESOURCE_SETPRIORITY
if(setpriority(PRIO_PROCESS,0,5)!=0)
{
fprintf(stderr, "Unable to set process priority to 5. Leaving default.\n");
}
#endif


From what I can tell, we should be able to move this to just before we close the file handles and then close stderr as well. Not positive as there is still more code I need to peruse.

tronite
10-06-2007, 15:33
I have been experiencing this issue for some time now, and it hasnt really been a problem. But, I have some free time now so I thought I would share it and see if anyone else is experiencing it.

I am running 1.1a6 on gentoo with the following
2.6.2 kernel
OpenSSH 3.6.1p2
MySQL 4.0.16
PHP 4.3.10
Apache/2.0.52

I access this box via ssh using putty for windows. If I ssh into the box and start any of the zabbix processes (server, sucker, trapper, agentd) when I logoff of ssh, the session hangs. It logs me out, but somthing is hanging it up, and putty doesnt close. If I ssh into the same box and do other things, when i logoff, no problems, clean exit. Its only if one of the zabbix processess gets started during a shell session.

I have had this issue with 1.0 stable, and all of the 1.1 alphas I have used (about 4 of the 7). Anyone else experiencing anything similar? Or, do you have any thoughts as to why this might be happening?

Thanks,

cooper

Maybe it was to do with your forwarding and neting?

tronite
10-06-2007, 15:35
It's a pity you never gave a response as to either you ever solved this or not. :(