Re: How to increase the max pty's on Freebsd 7.0?

2009-04-08 Thread Bernd Walter
On Wed, Apr 08, 2009 at 12:43:53PM +0100, Max Laier wrote:
> On Wednesday 08 April 2009 13:25:39 Bernd Walter wrote:
> > On Thu, Apr 02, 2009 at 08:10:03AM +0200, Ed Schouten wrote:
> > > * Paul Schenkeveld  wrote:
> > > > Or change 'pts' to, for example, 'pt' so without changing utmp and
> > > > related stuff we'll have space for a four digit pty number.
> > >
> > > I've noticed lots of apps already misbehave because of the pty(4) ->
> > > pts(4) migration. I guess using a new naming scheme would totally break
> > > stuff. There are lots of apps that do things like:
> > >
> > >   if (strncmp(tty, "tty", 3) != 0 && strncmp(tty, "pts/", 4) != 0)
> > >   printf("Not a valid pseudo-terminal!\n");
> > >
> > > But those are just workarounds. Our utmp format is broken anyway. It's
> > > not just UT_LINESIZE that's too small. I think we received many
> > > complaints from people who want to increase UT_HOSTSIZE as well.
> >
> > Well, UT_HOSTSIZE can't hold a full sized IPv6 address.
> 
> RFC 1924 (still needs four more, but avoids ridiculously large UT_HOSTSIZE ;)

It doesn't handle scope information ;-)

-- 
B.Walter  http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


Re: How to increase the max pty's on Freebsd 7.0?

2009-04-08 Thread Max Laier
On Wednesday 08 April 2009 13:25:39 Bernd Walter wrote:
> On Thu, Apr 02, 2009 at 08:10:03AM +0200, Ed Schouten wrote:
> > * Paul Schenkeveld  wrote:
> > > Or change 'pts' to, for example, 'pt' so without changing utmp and
> > > related stuff we'll have space for a four digit pty number.
> >
> > I've noticed lots of apps already misbehave because of the pty(4) ->
> > pts(4) migration. I guess using a new naming scheme would totally break
> > stuff. There are lots of apps that do things like:
> >
> > if (strncmp(tty, "tty", 3) != 0 && strncmp(tty, "pts/", 4) != 0)
> > printf("Not a valid pseudo-terminal!\n");
> >
> > But those are just workarounds. Our utmp format is broken anyway. It's
> > not just UT_LINESIZE that's too small. I think we received many
> > complaints from people who want to increase UT_HOSTSIZE as well.
>
> Well, UT_HOSTSIZE can't hold a full sized IPv6 address.

RFC 1924 (still needs four more, but avoids ridiculously large UT_HOSTSIZE ;)

-- 
/"\  Best regards,  | mla...@freebsd.org
\ /  Max Laier  | ICQ #67774661
 X   http://pf4freebsd.love2party.net/  | mla...@efnet
/ \  ASCII Ribbon Campaign  | Against HTML Mail and News
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


Re: How to increase the max pty's on Freebsd 7.0?

2009-04-08 Thread Bernd Walter
On Thu, Apr 02, 2009 at 08:10:03AM +0200, Ed Schouten wrote:
> * Paul Schenkeveld  wrote:
> > Or change 'pts' to, for example, 'pt' so without changing utmp and
> > related stuff we'll have space for a four digit pty number.
> 
> I've noticed lots of apps already misbehave because of the pty(4) ->
> pts(4) migration. I guess using a new naming scheme would totally break
> stuff. There are lots of apps that do things like:
> 
>   if (strncmp(tty, "tty", 3) != 0 && strncmp(tty, "pts/", 4) != 0)
>   printf("Not a valid pseudo-terminal!\n");
> 
> But those are just workarounds. Our utmp format is broken anyway. It's
> not just UT_LINESIZE that's too small. I think we received many
> complaints from people who want to increase UT_HOSTSIZE as well.

Well, UT_HOSTSIZE can't hold a full sized IPv6 address.

-- 
B.Walter  http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


Re: How to increase the max pty's on Freebsd 7.0?

2009-04-02 Thread Steven Hartland

Yep that's what I came up with after looking though the code thanks
for the link though, always good to get confirmation that I didn't
miss something.

   Regards
   Steve

- Original Message - 
From: "John Baldwin" 




On Wednesday 01 April 2009 1:55:12 pm Steven Hartland wrote:

How can I increase the maximum number or ptys available on FreeBSD 7.0?

It seems that currently the machine is maxing out at 512 but there is
still loads of capacity left on the machine.

Ideally would like to double at least the number of ttys available,
any help would be most appreciated.


http://people.freebsd.org/~jhb/patches/pty_1152.patch

This might require 7.1 instead of 7.0 as I simplified the pty allocation code 
in <= 7.x so that it was easier to add new ones.



This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. 


In the event of misdirection, illegible or incomplete transmission please 
telephone +44 845 868 1337
or return the E.mail to postmas...@multiplay.co.uk.

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


Re: How to increase the max pty's on Freebsd 7.0?

2009-04-02 Thread John Baldwin
On Wednesday 01 April 2009 1:55:12 pm Steven Hartland wrote:
> How can I increase the maximum number or ptys available on FreeBSD 7.0?
> 
> It seems that currently the machine is maxing out at 512 but there is
> still loads of capacity left on the machine.
> 
> Ideally would like to double at least the number of ttys available,
> any help would be most appreciated.

http://people.freebsd.org/~jhb/patches/pty_1152.patch

This might require 7.1 instead of 7.0 as I simplified the pty allocation code 
in <= 7.x so that it was easier to add new ones.

-- 
John Baldwin
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


Re: How to increase the max pty's on Freebsd 7.0?

2009-04-02 Thread Steven Hartland
0n Wed, Apr 01, 2009 at 10:53:06PM +0200, Ed Schouten wrote: 

You can increase the maximum amount of PTYs by editing a lot of source
files on your system. There is some good news: in -CURRENT we switched
to Unix98-style PTYs (/dev/pts/%u). Right now the maximum amount of PTYs
is limited to 1000 (0 to 999).



Thanks for the confirmation I've managed to patch our local source tree
to increase this to 1024. Seems the last patch to raise to 512 has one
bug so fixed that while I was there.

If anyone wants the patch set shout.

   Regards
   Steve


This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. 


In the event of misdirection, illegible or incomplete transmission please 
telephone +44 845 868 1337
or return the E.mail to postmas...@multiplay.co.uk.

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


Re: How to increase the max pty's on Freebsd 7.0?

2009-04-01 Thread Ed Schouten
Hi Alex,

* Wilkinson, Alex  wrote:
> 
> 0n Wed, Apr 01, 2009 at 10:53:06PM +0200, Ed Schouten wrote: 
> 
> >You can increase the maximum amount of PTYs by editing a lot of source
> >files on your system. There is some good news: in -CURRENT we switched
> >to Unix98-style PTYs (/dev/pts/%u). Right now the maximum amount of PTYs
> >is limited to 1000 (0 to 999).
> 
> What are "Unix98-style PTYs" ?

Unix98-style PTYS is a name often given to implementations of
pseudo-terminals that use a character device called /dev/ptmx to
allocate a new pseudo-terminal. After /dev/ptmx has been opened, it will
expose a new TTY in /dev/pts. The name of the TTY can be obtained using
routines like ptsname(). Operating systems like Linux and Solaris use
this as well.

FreeBSD's pts(4) driver also has a /dev/ptmx character device, but it's
just there for compatibility (Linux binary emulation, older -CURRENT
libcs). The preferred way to allocate pseudo-terminals is to call
posix_openpt(2).

An advantage of the current design is that allocating pseudo-terminals
can be done a lot more easily. On RELENG_[67] posix_openpt(3) is a libc
routine that has to loop through devfs to search for the first unused
pseudo-terminal. It also requires a set-uid utility (pt_chown) to change
the ownership of the TTY:


http://svn.freebsd.org/viewvc/base/stable/7/lib/libc/stdlib/grantpt.c?view=markup

In -CURRENT the TTYs are allocated on demand with the proper permissions
in place.

-- 
 Ed Schouten 
 WWW: http://80386.nl/


pgpbZIg13TEfl.pgp
Description: PGP signature


Re: How to increase the max pty's on Freebsd 7.0?

2009-04-01 Thread Ed Schouten
* Paul Schenkeveld  wrote:
> Or change 'pts' to, for example, 'pt' so without changing utmp and
> related stuff we'll have space for a four digit pty number.

I've noticed lots of apps already misbehave because of the pty(4) ->
pts(4) migration. I guess using a new naming scheme would totally break
stuff. There are lots of apps that do things like:

if (strncmp(tty, "tty", 3) != 0 && strncmp(tty, "pts/", 4) != 0)
printf("Not a valid pseudo-terminal!\n");

But those are just workarounds. Our utmp format is broken anyway. It's
not just UT_LINESIZE that's too small. I think we received many
complaints from people who want to increase UT_HOSTSIZE as well.

-- 
 Ed Schouten 
 WWW: http://80386.nl/


pgpvuMfsX7ctx.pgp
Description: PGP signature


Re: How to increase the max pty's on Freebsd 7.0?

2009-04-01 Thread Wilkinson, Alex

0n Wed, Apr 01, 2009 at 10:53:06PM +0200, Ed Schouten wrote: 

>You can increase the maximum amount of PTYs by editing a lot of source
>files on your system. There is some good news: in -CURRENT we switched
>to Unix98-style PTYs (/dev/pts/%u). Right now the maximum amount of PTYs
>is limited to 1000 (0 to 999).

What are "Unix98-style PTYs" ?

 -aW

IMPORTANT: This email remains the property of the Australian Defence 
Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 
1914.  If you have received this email in error, you are requested to contact 
the sender and delete the email.


___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


Re: How to increase the max pty's on Freebsd 7.0?

2009-04-01 Thread Paul Schenkeveld
On Wed, Apr 01, 2009 at 11:08:35PM +0200, Ed Schouten wrote:
> Hi Kostik,
> 
> * Kostik Belousov  wrote:
> > Can we switch to %x ? Or even, use some radix encoding of the number,
> > to allow alphabetical symbols too ?
> 
> I guess that would break a lot of existing libraries. For example: older
> RELENG_7/CURRENT libcs might still use TIOCGPTN. This ioctl just returns
> a number that is just printed into a device name using "/dev/pts/%u" as
> a format. I also suspect a lot of Linux/Solaris-minded software expects
> the names to be in decimal form.

Or change 'pts' to, for example, 'pt' so without changing utmp and
related stuff we'll have space for a four digit pty number.

-- Paul Schenkeveld
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


Re: How to increase the max pty's on Freebsd 7.0?

2009-04-01 Thread Ed Schouten
* Ed Schouten  wrote:
> I also thought about that, but the risks are probably too high. I think
> it's better to just redesign our utmp/wtmp/lastlog system. I guess we
> could do something like this:

I forgot one step:

> - Implement utmpx. At first utmpx should just be a set of wrappers
>   around utmp/wtmp/lastlog.
> - Migrate all applications to utmpx.

- Remove ttyslot() and .

> - Change the utmpx code to use some new fancy file format.

-- 
 Ed Schouten 
 WWW: http://80386.nl/


pgpThQaEOytzg.pgp
Description: PGP signature


Re: How to increase the max pty's on Freebsd 7.0?

2009-04-01 Thread Ed Schouten
Hi Kostik,

* Kostik Belousov  wrote:
> Can we switch to %x ? Or even, use some radix encoding of the number,
> to allow alphabetical symbols too ?

I guess that would break a lot of existing libraries. For example: older
RELENG_7/CURRENT libcs might still use TIOCGPTN. This ioctl just returns
a number that is just printed into a device name using "/dev/pts/%u" as
a format. I also suspect a lot of Linux/Solaris-minded software expects
the names to be in decimal form.

I also thought about that, but the risks are probably too high. I think
it's better to just redesign our utmp/wtmp/lastlog system. I guess we
could do something like this:

- Implement utmpx. At first utmpx should just be a set of wrappers
  around utmp/wtmp/lastlog.
- Migrate all applications to utmpx.
- Change the utmpx code to use some new fancy file format.

I think I can finish the first step before 8.0 if I start working on
this one of these weeks.

-- 
 Ed Schouten 
 WWW: http://80386.nl/


pgpJdd2GtY3g5.pgp
Description: PGP signature


Re: How to increase the max pty's on Freebsd 7.0?

2009-04-01 Thread Kostik Belousov
On Wed, Apr 01, 2009 at 10:53:06PM +0200, Ed Schouten wrote:
> Hi Steven,
> 
> * Steven Hartland  wrote:
> > How can I increase the maximum number or ptys available on FreeBSD 7.0?
> >
> > It seems that currently the machine is maxing out at 512 but there is
> > still loads of capacity left on the machine.
> >
> > Ideally would like to double at least the number of ttys available,
> > any help would be most appreciated.
> 
> You can increase the maximum amount of PTYs by editing a lot of source
> files on your system. There is some good news: in -CURRENT we switched
> to Unix98-style PTYs (/dev/pts/%u). Right now the maximum amount of PTYs
> is limited to 1000 (0 to 999).
> 
> We're currently limited to 7 characters (pts/999) because our utmp/
> wtmp/lastlog files only reserve 8 bytes for the TTY name. If you're
> brave enough, you can increase UT_LINESIZE in include/utmp.h and
> MAXPTSDEVS in sys/kern/tty_pts.c. Be sure to recompile everything and to
> remove your utmp/wtmp/lastlog files.

Can we switch to %x ? Or even, use some radix encoding of the number,
to allow alphabetical symbols too ?


pgpYSMuFFs3XB.pgp
Description: PGP signature


Re: How to increase the max pty's on Freebsd 7.0?

2009-04-01 Thread Ed Schouten
Hi Steven,

* Steven Hartland  wrote:
> How can I increase the maximum number or ptys available on FreeBSD 7.0?
>
> It seems that currently the machine is maxing out at 512 but there is
> still loads of capacity left on the machine.
>
> Ideally would like to double at least the number of ttys available,
> any help would be most appreciated.

You can increase the maximum amount of PTYs by editing a lot of source
files on your system. There is some good news: in -CURRENT we switched
to Unix98-style PTYs (/dev/pts/%u). Right now the maximum amount of PTYs
is limited to 1000 (0 to 999).

We're currently limited to 7 characters (pts/999) because our utmp/
wtmp/lastlog files only reserve 8 bytes for the TTY name. If you're
brave enough, you can increase UT_LINESIZE in include/utmp.h and
MAXPTSDEVS in sys/kern/tty_pts.c. Be sure to recompile everything and to
remove your utmp/wtmp/lastlog files.

-- 
 Ed Schouten 
 WWW: http://80386.nl/
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


Re: How to increase the max pty's on Freebsd 7.0?

2009-04-01 Thread Steven Hartland

I knew his sounded very familiar, seems I asked the same
question back in 2007 for 5.4 just it was capped at 256:
http://lists.freebsd.org/mailman/htdig/freebsd-hackers/2007-October/021852.html

I'm sure I also remember saying this limit had been removed in 7.x
but looking in the source for pqrsPQRS it seems there are several
places where this still hard coded:-

contrib/telnet/telnetd/sys_term.c:  for (cp = "pqrsPQRS"; *cp; cp++) {
lib/libc/stdlib/grantpt.c:#define   PTY_DEV1"pqrsPQRSlmnoLMNO"
lib/libutil/pty.c:  for (cp1 = "pqrsPQRSlmnoLMNO"; *cp1; cp1++) {
sys/kern/tty_pty.c:static const char names[] = "pqrsPQRSlmnoLMNOtuvwTUVWxyzXYZ";
sys/kern/tty_pty.c: * pts == 
/dev/tty[pqrsPQRSlmnoLMNO][0123456789abcdefghijklmnopqrstuv]
sys/kern/tty_pty.c: * ptc == 
/dev/pty[pqrsPQRSlmnoLMNO][0123456789abcdefghijklmnopqrstuv]
usr.sbin/ac/ac.c:   strchr("pqrsPQRS", 
usr.ut_line[3]) != 0 ||

So the questions are:-
1. Is the fix to this still to just to update these settings?
2. Is there any significance to the upper case lower case thing?
3. Are there any other restrictions on the letters that can be used?

- Original Message - 
From: "Steven Hartland"



How can I increase the maximum number or ptys available on FreeBSD 7.0?

It seems that currently the machine is maxing out at 512 but there is
still loads of capacity left on the machine.

Ideally would like to double at least the number of ttys available,
any help would be most appreciated.




This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. 


In the event of misdirection, illegible or incomplete transmission please 
telephone +44 845 868 1337
or return the E.mail to postmas...@multiplay.co.uk.

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"