It's my pty and I'll cry if I want to.

Setting up servers inside an etch chroot can lead to some interesting problems. The most recent problem for me happened when I tried to install the perl module IO::Tty. During the test I would keep getting the following error:
chrt:webdev2:~/.cpan/build/IO-Tty-1.07# make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-Iblib/lib" "-Iblib/arch" test.pl
1..4
Configuration: -DHAVE_DEV_PTMX -DHAVE_GETPT -DHAVE_GRANTPT -DHAVE_OPENPTY -DHAVE_PTSNAME -DHAVE_PTSNAME_
R -DHAVE_PTY_H -DHAVE_SIGACTION -DHAVE_SYS_STROPTS_H -DHAVE_TERMIOS_H -DHAVE_TERMIO_H -DHAVE_TTYNAME -DH
AVE_UNLOCKPT
Checking for appropriate ioctls: TIOCNOTTY TIOCSCTTY
Checking that returned fd's don't clash with stdin/out/err...
trying getpt()...
pty_allocate(nonfatal): getpt(): No such file or directory at /root/.cpan/build/IO-Tty-1.07/blib/lib/IO/
Pty.pm line 24.
trying openpty()...
pty_allocate(nonfatal): openpty(): No such file or directory at /root/.cpan/build/IO-Tty-1.07/blib/lib/I
O/Pty.pm line 24.
trying /dev/ptmx...
trying grantpt()...
IO::Tty::pty_allocate(nonfatal): grantpt(): No such file or directory at /root/.cpan/build/IO-Tty-1.07/b
lib/lib/IO/Pty.pm line 24.
trying unlockpt()...
trying ptsname_r()...
IO::Tty::open_slave(nonfatal): ptsname_r(): No such file or directory at /root/.cpan/build/IO-Tty-1.07/b
lib/lib/IO/Pty.pm line 24.
trying to open /dev/pts/3...
IO::Tty::open_slave(nonfatal): open(/dev/pts/3): No such file or directory at /root/.cpan/build/IO-Tty-1
.07/blib/lib/IO/Pty.pm line 24.
pty_allocate(nonfatal): open(/dev/ptmx): No such file or directory at /root/.cpan/build/IO-Tty-1.07/blib
/lib/IO/Pty.pm line 24.
trying BSD /dev/pty??...
Cannot open a pty at test.pl line 42
It turns out that this is due to the /dev directory not being configured correctly. The solution was not easy to find, so I shall post it here along with a link to the post that provided me with it, in the hopes that it will get bumped up the search listing. The answer, well there are two.
      	
      	cd /dev
      	./MAKEDEV pty
      	
      This creates a bunch of pty entries in /dev that can then be used when required.
      	mount -t devpts -o rw,gid=5,mode=620 none /dev/pts
      	
      This will mount /dev/pts and allow processes to create their own tty as needed.
I went for the 'MAKEDEV pty' option as I didn't want to mount /dev/pts everytime the machine was rebooted. So, there you have it. Now you wont cry when your pty isn't going the way you want it to.

This entry was posted on Thu, 21 Aug 2008 20:37:00 GMT and Posted in . You can follow any any response to this entry through the Atom feed. You can leave a comment .
Tags , , , ,


Comments

Leave a response

  1. Avatar
    londo over 2 years later:
    it worked :) ty for info.... seems its only place with right answer :) :) :)

Leave a comment


weewar.com corner