Server refused to allocate pty - solved (sort of)

Richard Pyne rpyne at kinfolk.org
Sun Feb 13 13:19:00 UTC 2005


On 13 Feb 2005 at 12:35, Jaime Buffery wrote:

> On Sat, Feb 12, 2005 at 10:01:14PM -0700, Richard Pyne wrote:
> > > Just running in debug didn't give a whole lot of useful 
> > > information, but the system log did show
> > > 
> > > [sshd] error: openpty: No such file or directory
> > > 
> > > Running under strace gave some somewhat helpful information, it 
> > > gave a whole series of errors like:
> > > 
> > > open("/dev/ptya0", O_RDWR) = -1 ENXIO (No such device or 
> > > address)
> > > .
> > > .
> > > .
> > > open("/dev/ptyef", O_RDWR) = -1 ENXIO (No such device or 
> > > address)
> > > 
> > > as it tried to open all 256 pty devices.
> > > 
> > > The puzzling part is that they exist as links into /dev/pty/m0 
> > > through /dev/pty/m255 which are all device nodes of major 2 
> > > minor 0-255 with permissions crw-rw-rw-
> > > 
> > > So now I see what is happening, but have no idea whay.
> > > 
> > > Thanks for your help.
> > 
> > The solution is (drum roll please) udev (with the default 
> > configuration) does not provide /dev/ptmx (major 5, minor 2).
> > manually creating it solved the problem.
> I'm running udev, and:
> 
> ls -l /dev/ptmx 
> crw-rw-rw-  1 root root 5, 2 2005-02-13 13:23 /dev/ptmx
> 
> In the permission file of 050 and before (that is generated from a patch file):
> 
> grep "ptmx"  udev-defaults-3.patch
> +ptmx:root:tty:0666

Ok, it is in the patch file and in /etc/udev/rules.d/49-
udev.rules I see:

KERNEL="ptmx", OWNER="$local", MODE="0666"
 
> > Now, on to the next one......
> > 
> > Is the 2.6 kernel with udev supposed to be using sysfs? I tried 
> > mounting it and then found that on a re-boot I get an "Unable to 
> > open initial console" and the boot hangs.
> $ lvu DEPENDS udev
> depends hotplug &&
> depends sysfsutils

Yup, I have hotplug and sysfsutils installed as well as udev.

> 
> proc -> sysfs -> udev. That is the right order they should be mounted and that's 
> the order they are mounted in the mount script ( see /etc/init.d/mount ).

This is where we differ. I see NOTHING in /etc/init.d/mount that 
specifically mounts proc, sysfs, or udev. There is, however 
specific code to mount devfs. I have lrm-ed devfs and deleted 
the related binaries.

There is an /etc/init.d/udev for mounting udev which exits if 
sysfs is not mounted which could explain the lack of /dev/ptmx. 
It is interesting that it is not scheduled to run until S20 
(after hotplug, network, and portmap).

/etc/fstab did not contain anything for udev or sysfs until I 
manually added a line for sysfs after proc. (I also move the 
tmpfs mounts for /var/lock and /var/run to the bottom so they 
can actually mount).

> > The only way I have found (so far) to recover is to boot from 
> > the install cd, copy the /dev directory from the cd to the hard 
> > drive, disable sysfs in /etc/fstab and reboot.
> > 
> > Any insights will be greatly appreciated.
> Various things could have happened:

> a ) Some ppl have suffered from problems with legacy pty's enabled in kernel 
> -not my case, but maybe yours.

I have UnixPTYs enabled, NOT BSD ptys

> b ) you have no hotplug in your kernel

I have hotplug in the kernel

> c ) you have removed sysfsutils

No.

> d ) you haven't read the 2.6 howto or any related documentation on udev.

Read it and followed it to the letter.

> e ) you haven't read the The kernel commandline /dev params mini-HowTo.

?? This I haven't seen (or found), but I did find mention (and 
added) the kernel commandline parameter "dev=udev".

Thanks for your patience. I really am trying to learn how to 
make this work.

--Richard



More information about the Lunar mailing list