Bug 125772

Summary: Increasing the number of ptys based on the FAQ results compilation error on FreeBSD 7.0
Product: Documentation Reporter: Unga <unga888>
Component: Books & ArticlesAssignee: Gabor Pali <pgj>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
books.faq.ptys.patch.diff
none
books.faq.ptys.patch.1.diff none

Description Unga 2008-07-19 16:30:00 UTC
As per FAQ,
http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/admin.html,
I tried to increase the number of ptys:
 "10.19.1
 Build and install a new kernel with the line in the
 configuration file:
 device pty N
 where N is the number of requested pseudoterminals."
 
I tried to recompile the kernel.  I have modified the
GENERIC as follows:
device          pty  64          # Pseudo-ttys (telnet etc)
 
This results a compilation error:
config: /usr/src/sys/i386/conf/GENERIC:268: syntax error
*** Error code 1
Comment 1 Gabor Pali freebsd_committer freebsd_triage 2008-07-19 16:32:01 UTC
Responsible Changed
From-To: freebsd-doc->pgj

I think it is my fault, so I should fix this.
Comment 2 John Baldwin freebsd_committer freebsd_triage 2008-07-21 16:21:28 UTC
> This results a compilation error:
> config: /usr/src/sys/i386/conf/GENERIC:268: syntax error
> *** Error code 1

Yeah, that approach (number in config file) hasn't been used since at least 
3.x.  The default on 7.0 is 512 pty's (vs 256 in 6.x).  Do you need more than 
that?

-- 
John Baldwin
Comment 3 Gabor Pali freebsd_committer freebsd_triage 2008-07-23 19:03:33 UTC
Here is a patch based on what we have discussed earlier.
Comment 4 John Baldwin freebsd_committer freebsd_triage 2008-07-23 19:39:32 UTC
On Wednesday 23 July 2008 02:03:33 pm Gabor PALI wrote:
> Here is a patch based on what we have discussed earlier.
> 

A few wording suggestions:

I would s/will probably run out/might run out/ since on newer snaps there are 
more pty's so this is less of an issue.  Also, you can use the approach in 
the pty_1152.patch w/o too much trouble on any 5.x+ system.  The patch is  
just slightly more cumbersome on 6.2 and older releases.  Based on all that, 
I would actually reword much of this to go something like this:

<para>
If you have a lot of telnet, ssh, X, or screen users, you might run out of 
pseudoterminals.  By default, &os;&nbsp;6.2 and earlier support 256 
pseudoterminals, while &os;&nbsp;6.3 and later support 512 pseudoterminals.
<para>

I would then keep the <tip> that you have, but possibly mention that the patch 
will only apply cleanly to 6.3 or later.

-- 
John Baldwin
Comment 5 Gabor Pali freebsd_committer freebsd_triage 2008-07-23 20:29:33 UTC
John Baldwin wrote:
> A few wording suggestions [..] I would then keep the <tip> that you
> have, but possibly mention that the patch will only apply cleanly to
> 6.3 or later.

Here is the updated patch according to your request.
Comment 6 Unga 2008-07-24 04:21:58 UTC
--- On Mon, 7/21/08, John Baldwin <jhb@freebsd.org> wrote:

> From: John Baldwin <jhb@freebsd.org>
> Subject: Re: docs/125772: Increasing the number of ptys based on the FAQ results compilation error on FreeBSD 7.0
> To: freebsd-doc@freebsd.org
> Cc: "Unga" <unga888@yahoo.com>, freebsd-gnats-submit@freebsd.org
> Date: Monday, July 21, 2008, 11:21 PM
> On Saturday 19 July 2008 11:25:47 am Unga wrote:
> > 
> > >Number:         125772
> > >Category:       docs
> > >Synopsis:       Increasing the number of ptys
> based on the FAQ results 
> compilation error on FreeBSD 7.0
> > >Confidential:   no
> > >Severity:       serious
> > >Priority:       low
> > >Responsible:    freebsd-doc
> > >State:          open
> > >Quarter:        
> > >Keywords:       
> > >Date-Required:
> > >Class:          doc-bug
> > >Submitter-Id:   current-users
> > >Arrival-Date:   Sat Jul 19 15:30:00 UTC 2008
> > >Closed-Date:
> > >Last-Modified:
> > >Originator:     Unga
> > >Release:        FreeBSD 7.0
> > >Organization:
> > >Environment:
> > >Description:
> > As per FAQ,
> >
> http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/admin.html,
> > I tried to increase the number of ptys:
> >  "10.19.1
> >  Build and install a new kernel with the line in the
> >  configuration file:
> >  device pty N
> >  where N is the number of requested
> pseudoterminals."
> >  
> > I tried to recompile the kernel.  I have modified the
> > GENERIC as follows:
> > device          pty  64          # Pseudo-ttys (telnet
> etc)
> >  
> > This results a compilation error:
> > config: /usr/src/sys/i386/conf/GENERIC:268: syntax
> error
> > *** Error code 1
> 
> Yeah, that approach (number in config file) hasn't been
> used since at least 
> 3.x.  The default on 7.0 is 512 pty's (vs 256 in 6.x). 
> Do you need more than 
> that?
> 

Hi 

Thanks for the reply. Its a shame on top the FAQ page shows "Frequently Asked Questions for FreeBSD 6.X and 7.X" and information is applicable for FreeBSD 3.x.

My issue was when I run expect -c "spawn ls", I get "The system has no more ptys. Ask your system administrator to create more.". Later I identified its was pt_chown was missing in my system caused to display this misleading error message.

The default on 7.0 is 512 pty's should be most probably enough. But I have proposal as follows:

1) Default number of pty's 512.

2) Give the option to increase to a new *hard limit* by recompiling the kernel as explained in the FAQ. 

3) Give a sysctl option to soft increase the pty limit up to the *hard limit*.

Thank you.

Best regards
Unga
Comment 7 John Baldwin freebsd_committer freebsd_triage 2008-07-24 16:25:20 UTC
On Wednesday 23 July 2008 11:21:58 pm Unga wrote:
> --- On Mon, 7/21/08, John Baldwin <jhb@freebsd.org> wrote:
> 
> > From: John Baldwin <jhb@freebsd.org>
> > Subject: Re: docs/125772: Increasing the number of ptys based on the FAQ 
results compilation error on FreeBSD 7.0
> > To: freebsd-doc@freebsd.org
> > Cc: "Unga" <unga888@yahoo.com>, freebsd-gnats-submit@freebsd.org
> > Date: Monday, July 21, 2008, 11:21 PM
> > On Saturday 19 July 2008 11:25:47 am Unga wrote:
> > > 
> > > >Number:         125772
> > > >Category:       docs
> > > >Synopsis:       Increasing the number of ptys
> > based on the FAQ results 
> > compilation error on FreeBSD 7.0
> > > >Confidential:   no
> > > >Severity:       serious
> > > >Priority:       low
> > > >Responsible:    freebsd-doc
> > > >State:          open
> > > >Quarter:        
> > > >Keywords:       
> > > >Date-Required:
> > > >Class:          doc-bug
> > > >Submitter-Id:   current-users
> > > >Arrival-Date:   Sat Jul 19 15:30:00 UTC 2008
> > > >Closed-Date:
> > > >Last-Modified:
> > > >Originator:     Unga
> > > >Release:        FreeBSD 7.0
> > > >Organization:
> > > >Environment:
> > > >Description:
> > > As per FAQ,
> > >
> > http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/admin.html,
> > > I tried to increase the number of ptys:
> > >  "10.19.1
> > >  Build and install a new kernel with the line in the
> > >  configuration file:
> > >  device pty N
> > >  where N is the number of requested
> > pseudoterminals."
> > >  
> > > I tried to recompile the kernel.  I have modified the
> > > GENERIC as follows:
> > > device          pty  64          # Pseudo-ttys (telnet
> > etc)
> > >  
> > > This results a compilation error:
> > > config: /usr/src/sys/i386/conf/GENERIC:268: syntax
> > error
> > > *** Error code 1
> > 
> > Yeah, that approach (number in config file) hasn't been
> > used since at least 
> > 3.x.  The default on 7.0 is 512 pty's (vs 256 in 6.x). 
> > Do you need more than 
> > that?
> > 
> 
> Hi 
> 
> Thanks for the reply. Its a shame on top the FAQ page shows "Frequently 
Asked Questions for FreeBSD 6.X and 7.X" and information is applicable for 
FreeBSD 3.x.
> 
> My issue was when I run expect -c "spawn ls", I get "The system has no more 
ptys. Ask your system administrator to create more.". Later I identified its 
was pt_chown was missing in my system caused to display this misleading error 
message.
> 
> The default on 7.0 is 512 pty's should be most probably enough. But I have 
proposal as follows:
> 
> 1) Default number of pty's 512.
> 
> 2) Give the option to increase to a new *hard limit* by recompiling the 
kernel as explained in the FAQ. 
> 
> 3) Give a sysctl option to soft increase the pty limit up to the *hard 
limit*.
> 
> Thank you.

pgj@ is working on a patch to update the documentation.  As far as changing 
the code, pgj's patch will explain how to update the hard limit.  However, 
there currently isn't any sort of soft limit, and given that all the pty 
stuff is being rewritten in 8.x to be centered on pts(4), it is doubtful that 
there ever will be a soft limit via sysctl (except that pts(4) effectively 
only has a "soft" limit where the hard limit is the amount of RAM you have).

-- 
John Baldwin
Comment 8 dfilter service freebsd_committer freebsd_triage 2008-07-29 19:11:40 UTC
pgj         2008-07-29 18:11:32 UTC

  FreeBSD doc repository

  Modified files:
    en_US.ISO8859-1/books/faq book.sgml 
  Log:
  Update Question 10.19.1:
  - Replace the old kernel configuration method
    with some info on the current limits and
    mention jhb's patch
  
  PR:             docs/125772
  Submitted by:   Unga <unga888 (at) yahoo (dot) com>
  Discussed with: rwatson, jhb
  Reviewed by:    jhb, gabor
  Approved by:    gabor
  
  Revision  Changes    Path
  1.1079    +15 -38    doc/en_US.ISO8859-1/books/faq/book.sgml
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 9 Gabor Pali freebsd_committer freebsd_triage 2008-07-29 19:26:21 UTC
State Changed
From-To: open->closed

A patch was created and committed to solve your problem.  Thank you for 
your submission!