Monday, October 20, 2008

Gotcha Of The Day - screen not starting up - no ptys found

While setting up a new Linux server (hmmm, this seems to be a weekly occurance), my first order of business was to install screen. That way, a lost ssh connection doesn't mean a lost working session.

I installed screen by saying:

sudo yum install screen

I went to run screen and was greeted with the error message No more Ptys. This took a fair amount of Googling to solve. Eventually, I figured out that this was related to some incorrectly created /dev/* files.

The fix boiled down to:

mknod /dev/ptmx c 5 2
chmod 666 /dev/ptmx
mkdir /dev/pts 
chmod 755 /dev/pts

mount -t devpts -o gid=4,mode=620 none /dev/pts

It's also a good idea to confirm your /etc/fstab includes a devpts entry like:

devpts  /dev/pts   devpts  gid=5,mode=620  0 0

Once the problem was solved, I could get back to the fun work of copying over files, creating new databases and generally getting the server humming along.

2 comments:

  1. I'll have to keep this in mind in case I ever run into the same problem. scree is probably my favorite unix utility, especially as a telecommuter.

    ReplyDelete
  2. Yeah, screen is a work of art. It's just awesome.

    I simply wasn't going to work on a server that didn't provide it.

    -Ben

    ReplyDelete