Re: Pseudoterminals increase: compilation error [SOLVED]

2008-07-20 Thread Unga
--- On Sun, 7/20/08, Peter Jeremy <[EMAIL PROTECTED]> wrote:

> From: Peter Jeremy <[EMAIL PROTECTED]>
> Subject: Re: Pseudoterminals increase: compilation error
> To: "Unga" <[EMAIL PROTECTED]>
> Cc: freebsd-stable@freebsd.org
> Date: Sunday, July 20, 2008, 6:37 PM
> On 2008-Jul-19 19:44:18 -0700, Unga
> <[EMAIL PROTECTED]> wrote:
> >truss -o truss.log -f expect -c "spawn ls"
> >
> > 1178: open("/dev/ptyp0",O_RDWR,027757763030)
>ERR#5 'Input/output error'
> > 1178: open("/dev/ptyp1",O_RDWR,027757763030)
>ERR#5 'Input/output error'
> > 1178: open("/dev/ptyp2",O_RDWR,027757763030)
>= 5 (0x5)
> > 1178: fstat(5,{mode=crw-rw-rw-
> ,inode=178,size=0,blksize=4096}) = 0 (0x0)
> > :
> > :
> > 1178: chown("/dev/ttyp2",1002,4)
>ERR#1 'Operation not permitted'
> 
> This is definitely wrong.  expect should not be calling
> chown(2),
> it should be calling pt_chown.
> 

Yep, it was pt_chown was missing. Fixed the issue. Now ttyp* are created with 
correct ownerships.

A big thank specially to Peter Jeremy and all others who helped me to solve 
this. 

Best regards
Unga


  
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Pseudoterminals increase: compilation error

2008-07-20 Thread Unga
--- On Sun, 7/20/08, Peter Jeremy <[EMAIL PROTECTED]> wrote:

> From: Peter Jeremy <[EMAIL PROTECTED]>
> Subject: Re: Pseudoterminals increase: compilation error
> To: "Unga" <[EMAIL PROTECTED]>
> Cc: freebsd-stable@freebsd.org
> Date: Sunday, July 20, 2008, 6:37 PM
> On 2008-Jul-19 19:44:18 -0700, Unga
> <[EMAIL PROTECTED]> wrote:
> >truss -o truss.log -f expect -c "spawn ls"
> >
> > 1178: open("/dev/ptyp0",O_RDWR,027757763030)
>ERR#5 'Input/output error'
> > 1178: open("/dev/ptyp1",O_RDWR,027757763030)
>ERR#5 'Input/output error'
> > 1178: open("/dev/ptyp2",O_RDWR,027757763030)
>= 5 (0x5)
> > 1178: fstat(5,{mode=crw-rw-rw-
> ,inode=178,size=0,blksize=4096}) = 0 (0x0)
> > :
> > :
> > 1178: chown("/dev/ttyp2",1002,4)
>ERR#1 'Operation not permitted'
> 
> This is definitely wrong.  expect should not be calling
> chown(2),
> it should be calling pt_chown.
> 
Hmm...that's a good point. I'll check that.


> >I'm using Expect-5.43.0 compiled from sources.
> >
> >So, it looks like some sort of a misconfiguration.
> Still investigating.
> 
> Have you built the FreeBSD port or used your own build
> configuration?
> If the latter, I suggest you build the port - it works for
> me.
> 

Yes, I build my own build configuration. Anyway, I'll check what are the 
patches applied by the FreeBSD port.

Unga


  
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Pseudoterminals increase: compilation error

2008-07-20 Thread Peter Jeremy
On 2008-Jul-19 19:44:18 -0700, Unga <[EMAIL PROTECTED]> wrote:
>truss -o truss.log -f expect -c "spawn ls"
>
> 1178: open("/dev/ptyp0",O_RDWR,027757763030)ERR#5 'Input/output error'
> 1178: open("/dev/ptyp1",O_RDWR,027757763030)ERR#5 'Input/output error'
> 1178: open("/dev/ptyp2",O_RDWR,027757763030)= 5 (0x5)
> 1178: fstat(5,{mode=crw-rw-rw- ,inode=178,size=0,blksize=4096}) = 0 (0x0)
> :
> :
> 1178: chown("/dev/ttyp2",1002,4)ERR#1 'Operation not 
> permitted'

This is definitely wrong.  expect should not be calling chown(2),
it should be calling pt_chown.

>I'm using Expect-5.43.0 compiled from sources.
>
>So, it looks like some sort of a misconfiguration. Still investigating.

Have you built the FreeBSD port or used your own build configuration?
If the latter, I suggest you build the port - it works for me.

-- 
Peter Jeremy
Please excuse any delays as the result of my ISP's inability to implement
an MTA that is either RFC2821-compliant or matches their claimed behaviour.


pgpJWcB8BpLRs.pgp
Description: PGP signature


Re: Pseudoterminals increase: compilation error

2008-07-19 Thread Unga
--- On Sun, 7/20/08, Unga <[EMAIL PROTECTED]> wrote:

> From: Unga <[EMAIL PROTECTED]>
> Subject: Re: Pseudoterminals increase: compilation error
> To: "Dan Nelson" <[EMAIL PROTECTED]>
> Cc: freebsd-stable@freebsd.org
> Date: Sunday, July 20, 2008, 10:44 AM
> --- On Sun, 7/20/08, Dan Nelson
> <[EMAIL PROTECTED]> wrote:
> 
> > Expect's error message doesn't say anything
> except
> > "something isn't
> > working but I won't tell you what".  Run
> > 
> > truss -o truss.log -f expect -c "spawn ls" 
> > 
> > and determine which syscall is failing, with what
> error
> > number, just
> > before expect prints its "no more ptys"
> message. 
> > That will tell you
> > whether it's a permissions issue, or something
> else. 
> > If there are no
> > obvious errors, post a part of the log.
> > 
> > Also, what version of expect are you running? 
> Versions
> > between
> > 5.38.0_1 and 5.43.0_2 had a bug in the port Makefile
> that
> > limited the
> > number of ptys expect could see.  See
> > http://www.freebsd.org/cgi/query-pr.cgi?pr=108311 .
> > 
> 
> Here are more detail. In fact, I noted it through strace
> after my previous email. 
> 
> ls -l /dev/ | grep pty
> crw-rw-rw-  1 root  wheel   0, 169 Jul 20 10:11 ptyp0
> crw-rw-rw-  1 root  wheel   0, 171 Jul 20 10:22 ptyp1
> 
> truss -o truss.log -f expect -c "spawn ls"
> 
>  1178: open("/dev/ptyp0",O_RDWR,027757763030)   
> ERR#5 'Input/output error'
>  1178: open("/dev/ptyp1",O_RDWR,027757763030)   
> ERR#5 'Input/output error'
>  1178: open("/dev/ptyp2",O_RDWR,027757763030)   
> = 5 (0x5)
>  1178: fstat(5,{mode=crw-rw-rw-
> ,inode=178,size=0,blksize=4096}) = 0 (0x0)
>  :
>  :
>  1178: chown("/dev/ttyp2",1002,4)   
> ERR#1 'Operation not permitted'
>  1178: close(5)  = 0 (0x0)
>  1178: close(-1) ERR#9
> 'Bad file descriptor'
>  1178: close(-1) ERR#9
> 'Bad file descriptor'
>  1178: open("/",O_RDONLY,027757764430)  
> = 5 (0x5)
>  1178: close(5)  = 0 (0x0)
>  1178: write(2,"The system has no more ptys. 
> As"...,106) = 106 (0x6a)
>  1178: write(2,"\r\n",2) 
>= 1179 (0x49b)
>  = 2 (0x2)
> 
> ls -l /dev/ | grep pty
> crw-rw-rw-  1 root  wheel   0, 169 Jul 20 10:11 ptyp0
> crw-rw-rw-  1 root  wheel   0, 171 Jul 20 10:23 ptyp1
> crw-rw-rw-  1 root  wheel   0, 178 Jul 20 10:11 ptyp2
> 
> I'm using Expect-5.43.0 compiled from sources.
> 
> So, it looks like some sort of a misconfiguration. Still
> investigating.
> 

Here is a more narrow down. This problem is happening inside a chroot jail but 
only as a normal user:

Here is what it create for following command:
expect -c "spawn ls"

On FreeBSD
==
crw--w  1 test tty 0, 181 Jul 20 10:11 ttyp3

On chroot
=
crw-rw-rw-  1 root  wheel   0, 181 Jul 20 10:11 ttyp3

For some reason devfs creates ttys differently.

"devfs rule showsets" shows same for both /dev and /path/dev. Its just 1, 2, 3, 
4.

I tried to add a new ruleset as follows (inside chroot jail):
devfs ruleset 10
devfs rule add path tty* type tty mode 660 group tty
devfs rule applyset

Now devfs creates ttys as follows:
crw-rw  1 root  tty 0, 179 Jul 20 13:08 ttyp2

So, now the question is how to get the devfs to create ttys owned by the 
requested user? or can it be something else?

As for Gavin's suggestion to upgrade to Expect-5.43.0_2, actually, there is no 
such version on http://expect.nist.gov/, latest is still Expect-5.43.0.

Regards
Unga



  
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Pseudoterminals increase: compilation error

2008-07-19 Thread Unga
--- On Sun, 7/20/08, Dan Nelson <[EMAIL PROTECTED]> wrote:

> Expect's error message doesn't say anything except
> "something isn't
> working but I won't tell you what".  Run
> 
> truss -o truss.log -f expect -c "spawn ls" 
> 
> and determine which syscall is failing, with what error
> number, just
> before expect prints its "no more ptys" message. 
> That will tell you
> whether it's a permissions issue, or something else. 
> If there are no
> obvious errors, post a part of the log.
> 
> Also, what version of expect are you running?  Versions
> between
> 5.38.0_1 and 5.43.0_2 had a bug in the port Makefile that
> limited the
> number of ptys expect could see.  See
> http://www.freebsd.org/cgi/query-pr.cgi?pr=108311 .
> 

Here are more detail. In fact, I noted it through strace after my previous 
email. 

ls -l /dev/ | grep pty
crw-rw-rw-  1 root  wheel   0, 169 Jul 20 10:11 ptyp0
crw-rw-rw-  1 root  wheel   0, 171 Jul 20 10:22 ptyp1

truss -o truss.log -f expect -c "spawn ls"

 1178: open("/dev/ptyp0",O_RDWR,027757763030)ERR#5 'Input/output error'
 1178: open("/dev/ptyp1",O_RDWR,027757763030)ERR#5 'Input/output error'
 1178: open("/dev/ptyp2",O_RDWR,027757763030)= 5 (0x5)
 1178: fstat(5,{mode=crw-rw-rw- ,inode=178,size=0,blksize=4096}) = 0 (0x0)
 :
 :
 1178: chown("/dev/ttyp2",1002,4)ERR#1 'Operation not permitted'
 1178: close(5)  = 0 (0x0)
 1178: close(-1) ERR#9 'Bad file descriptor'
 1178: close(-1) ERR#9 'Bad file descriptor'
 1178: open("/",O_RDONLY,027757764430)   = 5 (0x5)
 1178: close(5)  = 0 (0x0)
 1178: write(2,"The system has no more ptys.  As"...,106) = 106 (0x6a)
 1178: write(2,"\r\n",2) = 1179 (0x49b)
 = 2 (0x2)

ls -l /dev/ | grep pty
crw-rw-rw-  1 root  wheel   0, 169 Jul 20 10:11 ptyp0
crw-rw-rw-  1 root  wheel   0, 171 Jul 20 10:23 ptyp1
crw-rw-rw-  1 root  wheel   0, 178 Jul 20 10:11 ptyp2

I'm using Expect-5.43.0 compiled from sources.

So, it looks like some sort of a misconfiguration. Still investigating.

Regards
Unga



  
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Pseudoterminals increase: compilation error

2008-07-19 Thread Dan Nelson
In the last episode (Jul 19), Unga said:
> On Sat, 7/19/08, Peter Jeremy  wrote:
> > On 2008-Jul-18 18:38:36 -0700, Unga wrote:
> > >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."
> > 
> > That has been obsolete for a while.  Do you actually have a problem
> > with insufficient PTYs?
> 
> Looks like, may not be.
> 
> The Problem: 
> expect -c "spawn ls"
> spawn ls
> The system has no more ptys.  Ask your system administrator to create
>  more. while executing "spawn ls"
> 
> It now seems to be a permission problem as explained in
> http://expect.nist.gov/FAQ.html#q67 .
> 
> Still investigating. Any help will be very much appreciated.

Expect's error message doesn't say anything except "something isn't
working but I won't tell you what".  Run

truss -o truss.log -f expect -c "spawn ls" 

and determine which syscall is failing, with what error number, just
before expect prints its "no more ptys" message.  That will tell you
whether it's a permissions issue, or something else.  If there are no
obvious errors, post a part of the log.

Also, what version of expect are you running?  Versions between
5.38.0_1 and 5.43.0_2 had a bug in the port Makefile that limited the
number of ptys expect could see.  See
http://www.freebsd.org/cgi/query-pr.cgi?pr=108311 .

-- 
Dan Nelson
[EMAIL PROTECTED]
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Pseudoterminals increase: compilation error

2008-07-19 Thread Unga
--- On Sat, 7/19/08, Peter Jeremy <[EMAIL PROTECTED]> wrote:

> From: Peter Jeremy <[EMAIL PROTECTED]>
> Subject: Re: Pseudoterminals increase: compilation error
> To: "Unga" <[EMAIL PROTECTED]>
> Cc: freebsd-stable@freebsd.org
> Date: Saturday, July 19, 2008, 8:04 PM
> On 2008-Jul-18 18:38:36 -0700, Unga
> <[EMAIL PROTECTED]> wrote:
> >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."
> 
> That has been obsolete for a while.  Do you actually have a
> problem
> with insufficient PTYs?
> 

Looks like, may not be.

The Problem: 
expect -c "spawn ls"
spawn ls
The system has no more ptys.  Ask your system administrator to create more.
 while executing "spawn ls"

It now seems to be a permission problem as explained in 
http://expect.nist.gov/FAQ.html#q67 .

Still investigating. Any help will be very much appreciated.

Unga


  
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Pseudoterminals increase: compilation error

2008-07-19 Thread Peter Jeremy
On 2008-Jul-18 18:38:36 -0700, Unga <[EMAIL PROTECTED]> wrote:
>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."

That has been obsolete for a while.  Do you actually have a problem
with insufficient PTYs?

-- 
Peter Jeremy
Please excuse any delays as the result of my ISP's inability to implement
an MTA that is either RFC2821-compliant or matches their claimed behaviour.


pgpgdPMmJSPjj.pgp
Description: PGP signature


Re: Pseudoterminals increase: compilation error

2008-07-18 Thread Unga
--- On Sat, 7/19/08, Unga <[EMAIL PROTECTED]> wrote:

> From: Unga <[EMAIL PROTECTED]>
> Subject: Re: Pseudoterminals increase: compilation error
> To: "Steven Hartland" <[EMAIL PROTECTED]>
> Cc: freebsd-stable@freebsd.org
> Date: Saturday, July 19, 2008, 10:50 AM
> --- On Sat, 7/19/08, Steven Hartland
> <[EMAIL PROTECTED]> wrote:
> 
> > From: Steven Hartland <[EMAIL PROTECTED]>
> > Subject: Re: Pseudoterminals increase: compilation
> error
> > To: [EMAIL PROTECTED]
> > Cc: freebsd-stable@freebsd.org
> > Date: Saturday, July 19, 2008, 10:38 AM
> > Ahh according to the man page its not a sysctl:
> > kern.pts.max 
> > 
> > man 4 pty for more info.
> > 
> 
> I use the the original BSD pty. According to the man page
> kern.pts.max  is for SysVR4 pts-like implementation, well,
> that how I understand. Anyway, I'll give it a try and
> let the list know.
> 

Ooops, I forgot: kern.pts.max defaults to 1000.

If this is the default, I may not have a problem :)

Regards
Unga


  
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Pseudoterminals increase: compilation error

2008-07-18 Thread Unga
--- On Sat, 7/19/08, Steven Hartland <[EMAIL PROTECTED]> wrote:

> From: Steven Hartland <[EMAIL PROTECTED]>
> Subject: Re: Pseudoterminals increase: compilation error
> To: [EMAIL PROTECTED]
> Cc: freebsd-stable@freebsd.org
> Date: Saturday, July 19, 2008, 10:38 AM
> Ahh according to the man page its not a sysctl:
> kern.pts.max 
> 
> man 4 pty for more info.
> 

I use the the original BSD pty. According to the man page kern.pts.max  is for 
SysVR4 pts-like implementation, well, that how I understand. Anyway, I'll give 
it a try and let the list know.

Regards
Unga


  
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Pseudoterminals increase: compilation error

2008-07-18 Thread Steven Hartland

Ahh according to the man page its not a sysctl:
kern.pts.max 


man 4 pty for more info.

- Original Message - 
From: "Unga" <[EMAIL PROTECTED]>

Hi, thanks for the reply.

I get this error: "The system has no more ptys. Ask your system administrator to 
create more."

1) That is, this error message is nothing to do with ptys? What does it trying 
to say then?

2) Even if ptys are totally dynamic in 7, what is the upper limit and where it 
is defined? in which source file or header file?

Please answer if you know this. I'm really stuck.




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 [EMAIL PROTECTED]

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Pseudoterminals increase: compilation error

2008-07-18 Thread Unga
--- On Sat, 7/19/08, Steven Hartland <[EMAIL PROTECTED]> wrote:

> From: Steven Hartland <[EMAIL PROTECTED]>
> Subject: Re: Pseudoterminals increase: compilation error
> To: [EMAIL PROTECTED], freebsd-stable@freebsd.org
> Date: Saturday, July 19, 2008, 10:15 AM
> iirc pty is totally dynamic in 7 and doesn't require any
> special tweaks.
> 
Hi, thanks for the reply.

I get this error: "The system has no more ptys. Ask your system administrator 
to create more."

1) That is, this error message is nothing to do with ptys? What does it trying 
to say then?

2) Even if ptys are totally dynamic in 7, what is the upper limit and where it 
is defined? in which source file or header file?

Please answer if you know this. I'm really stuck.

kind regards
Unga




  
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Pseudoterminals increase: compilation error

2008-07-18 Thread Steven Hartland

iirc pty is totally dynamic in 7 and doesn't require any special tweaks.

   Regards
   Steve

- Original Message - 
From: "Unga" <[EMAIL PROTECTED]>

To: 
Sent: Saturday, July 19, 2008 2:38 AM
Subject: Pseudoterminals increase: compilation error



Hi all

I'm using FreeBSD 7.0.

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

What is the correct syntax?

Kind Regards
Unga


 
___

freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"




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 [EMAIL PROTECTED]

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Pseudoterminals increase: compilation error

2008-07-18 Thread Unga
Hi all

I'm using FreeBSD 7.0.

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

What is the correct syntax?

Kind Regards
Unga


  
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"