System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Server refused to allocate pty , ttytype: couldn't open /dev/tty for reading

adr33
Occasional Advisor

Server refused to allocate pty , ttytype: couldn't open /dev/tty for reading

Dear all,

 

I have hp-ux server with 11.11 OS version, Today with suddenly I can't remote my server with telnet or putty (ssh) eve ftp.

But I can use it well with terminal (directly through server).

 

I've checked the syslog.log and found this below:

error:openpty:Bad file number

error:session_pty_req:session 0 alloc failed.

 

I've read some articles in this forum and try to restart my server but not solve the problem,

Anyone can tell me what happen to my server? it's a bug or something else?

 

Thanks

Best Regards

Adrian Tjahjana

11 REPLIES
Dennis Handly
Acclaimed Contributor

Re: Server refused to allocate pty, ttytype: couldn't open /dev/tty for reading

>suddenly I can't remote my server with telnet or putty (ssh) even ftp.

 

What does kmtune(1m) show for npty nstrpty nstrtel?

You may need to use SAM to make these larger.

adr33
Occasional Advisor

Re: Server refused to allocate pty , ttytype: couldn't open /dev/tty for reading

Hi how I can show kmtune(1m) for npty nstrpty nstrtel? Thanks
Dennis Handly
Acclaimed Contributor

Re: Server refused to allocate pty, ttytype: couldn't open /dev/tty for reading

>how I can show kmtune(1m) for npty nstrpty nstrtel?

 

Check the kmtune(1m) man page:

kmtune -q npty -q nstrpty -q nstrtel

adr33
Occasional Advisor

Re: Server refused to allocate pty, ttytype: couldn't open /dev/tty for reading

Hi, here's the parameter, anything wrong? Parameter Current Dyn Planned Module Version =============================================================================== npty 60 - 60 nstrpty 60 - 60 nstrtel 60 - 60
Dennis Handly
Acclaimed Contributor

Re: Server refused to allocate pty, ttytype: couldn't open /dev/tty for reading

>npty 60 - 60  nstrpty 60 - 60 nstrtel 60 - 60

 

Do you have more than 60 people trying to log on?  You may have to use SAM to increase these limits.

adr33
Occasional Advisor

Re: Server refused to allocate pty, ttytype: couldn't open /dev/tty for reading

no it's only for around 50 users no more than 60, after I reboot the server the problem still occur.

it's corrupt maybe?

Dennis Handly
Acclaimed Contributor

Re: Server refused to allocate pty, ttytype: couldn't open /dev/tty for reading

>after I reboot the server the problem still occur.

 

If you are going to reboot anyway, you might as well use SAM to increase these kernel parms.

Bill Hassell
Honored Contributor

Re: Server refused to allocate pty, ttytype: couldn't open /dev/tty for reading

... no it's only for around 50 users no more than 60, after I reboot the server the problem still occur.

it's corrupt maybe?

 

60 is the default and is way too small for 50 users. Every time a user logs in, you need a pty pair. This also includes all the junk logins caused by users that don't log out properly. Change all 3 parameters (npty, nstrtel and nstrpty) to 200, perhaps 500. There is no reason to have the system jam up due to a very small kernel parameter. By changing all 3 to a large value, you won't have this problem in the foreseeable future.



Bill Hassell, sysadmin
adr33
Occasional Advisor

Re: Server refused to allocate pty, ttytype: couldn't open /dev/tty for reading

Hi,
finally I restore the ignite and not to increase the kernel parms and the problem is solve, before the problem occur my /tmp file going to be 100% and the problem occur after that. It because of full space of tmp folder?
Dennis Handly
Acclaimed Contributor

Re: Server refused to allocate pty, ttytype: couldn't open /dev/tty for reading

>It because of full space of tmp folder?

 

Running out of space in /tmp can cause all types of problems, including not being able to logon, especially if / is full.  (Which sounds like your problem.)

I'm not sure why it mentions /dev/tty if /tmp is full?

adr33
Occasional Advisor

Re: Server refused to allocate pty, ttytype: couldn't open /dev/tty for reading

no idea about the relationship between them, but I can connect through my server before /tmp is 100 %. Not sure why it can be 100% suddenly. I've searched the issued about /dev/tty things and you're right it about to setting the parameter. I've checked too and I see that my DAEMON is failed to start when I reboot the server