Bill Lewis Posted February 23, 2006 Report Share Posted February 23, 2006 Anyone know how to increase the number of pty's the system has available? I just did an install and found that some of my scripts that fire up 10 or more xterms do not execute because after several xterms appear the shell starts spewing "no available ptys". I've never seen that on any distro before. Quote Link to comment Share on other sites More sharing options...
Steve Scrimpshire Posted February 24, 2006 Report Share Posted February 24, 2006 Is this Mandrake 10? If so, there is a possible fix here: http://cxterm.sourceforge.net/ because i highly doubt this number on your system is incorrect or insufficient: < root /etc > cat /proc/sys/kernel/pty/max 4096 Quote Link to comment Share on other sites More sharing options...
Bill Lewis Posted February 24, 2006 Author Report Share Posted February 24, 2006 Steve, I installed Mandriva 2006 Powerpack. /proc/sys/kernel/pty/max is 4096, but there are only 10 pty devices configured. I checked my other 2 machines(redhat, suse) and both of them have 256 devices configured. Looks like Mandriva has 256 links in /dev to 10 configured pty devices in /dev/pty. This appears to be the problem because I can only get 10 xterms to work simultaneously. I used 'mknod' to create additional devices and then changed some of the duplicated links to point to them, but these all disappear after a reboot. Seems like it's some kind of configuration issue. I looked in rc.sysinit but couldn't really find anything that is related to the problem. Any other ideas welcome. thanx. -bill Quote Link to comment Share on other sites More sharing options...
ianw1974 Posted February 25, 2006 Report Share Posted February 25, 2006 You can use the /etc/rc.local file to recreate all the entries when you reboot the system. I used this once for creating devices under /dev. Just add the commands to the file as you would type them normally in a console window. Quote Link to comment Share on other sites More sharing options...
Bill Lewis Posted February 25, 2006 Author Report Share Posted February 25, 2006 That is my last resort. I more interested in finding out where, in the system boot sequence, this is done and make the change there. The way Mandriva configures it is bullshit. Every other distro I've looked at provides 256 actual pty's, not 256 links to 10 pty's/. Whoever decided that 10 pty's was enough needs to have his head pulled out of his butt. Quote Link to comment Share on other sites More sharing options...
Steve Scrimpshire Posted February 26, 2006 Report Share Posted February 26, 2006 I use the latest Mandriva and I have 256 pty's created at boot. I searched in vain to find where/how they are created, but I assume the small amount of pty's on your system has something to do with your security level. Quote Link to comment Share on other sites More sharing options...
Bill Lewis Posted February 26, 2006 Author Report Share Posted February 26, 2006 Thanks for taking a look. I've already wasted a shitload of time grepping the shit out of rc and etc dirs with no luck. It's not a security issue as I don't even have a firewall installed. My system contains 256 tty/pty pairs configured in dev but they are symbolic links to 11 "physical" tty/pty pairs in /dev/pty: lrwxrwxrwx 1 root root 6 Feb 26 07:02 ttyp0 -> pty/s0 lrwxrwxrwx 1 root root 6 Feb 26 07:02 ttyp1 -> pty/s1 lrwxrwxrwx 1 root root 6 Feb 26 07:02 ttyp2 -> pty/s2 lrwxrwxrwx 1 root root 6 Feb 26 07:02 ttyp3 -> pty/s3 lrwxrwxrwx 1 root root 6 Feb 26 07:02 ttyp4 -> pty/s4 lrwxrwxrwx 1 root root 6 Feb 26 07:02 ttyp5 -> pty/s5 lrwxrwxrwx 1 root root 6 Feb 26 07:02 ttyp6 -> pty/s6 lrwxrwxrwx 1 root root 6 Feb 26 07:02 ttyp7 -> pty/s7 lrwxrwxrwx 1 root root 6 Feb 26 07:02 ttyp8 -> pty/s8 lrwxrwxrwx 1 root root 6 Feb 26 07:02 ttyp9 -> pty/s9 lrwxrwxrwx 1 root root 5 Feb 26 07:02 ttypa -> pty/s lrwxrwxrwx 1 root root 5 Feb 26 07:02 ttypb -> pty/s lrwxrwxrwx 1 root root 5 Feb 26 07:02 ttypc -> pty/s lrwxrwxrwx 1 root root 5 Feb 26 07:02 ttypd -> pty/s lrwxrwxrwx 1 root root 5 Feb 26 07:02 ttype -> pty/s lrwxrwxrwx 1 root root 5 Feb 26 07:02 ttypf -> pty/s there are 15 other tty'x' configurations just like this. As soon as I have 11 mxterms running I start to get "no available pty's". I've added more in rc.local along with the necessary symbolic links to access the new devices but the kernel does not seem to recognize them and I'm still restricted to 11 pty's. As I somtimes use as many as 40 pty's simultaneously while working, Mandriva is currently a huge failure in my book. Might be some real flaming in the works if Mandriva doesn't step up and provide an answer. Checked 3 other distro's I've still have sitting around on other machines and all of them have 256 actual tty/pty pairs at installation. As I said previously, someone at Mandriva needs to have his head pulled out of his ass. This is just the kind of BS that continues to assure that Linux stays out of the mainstream. Thanx again. -bill Quote Link to comment Share on other sites More sharing options...
pmpatrick Posted February 27, 2006 Report Share Posted February 27, 2006 (edited) I am fairly certain you will have to look in the udev rules, db, ect to alter that behaviour if you want to do it directly. udev is responsible for generating device files with the the current 2.6 kernel that mandriva uses AFAIK. I see references to pty symlinking in /etc/udev/rules.d/50-mdk.rules starting at around line 214. All looks pretty cryptic to me. In fact, udev configuration in general reminds me of bad memories with the windows registry. I think making the changes in rc.local would be much easier unless you're very familiar with udev. Also, this is not an official mandriva site; in fact we are a very unofficial group of mandriva users. If you want to complain about the mandriva design, go to the official site and make your opinion known. Personally, I have never found this limitation to be a problem and was unaware of it's existence. I guess I just never needed to execute more than ten exterms simultaneously. I don't doubt that you have very good reasons for designing your scripts this way but I don't think it's something that most people are going to run into. In fact, you seem to be the first one to discover this problem and mdv2006 has been out for a while and LE2005 seems to have the same system in place. At any rate, if you're unhappy about it, go to the official mandriva site and give them a piece of your mind. Edited February 27, 2006 by pmpatrick Quote Link to comment Share on other sites More sharing options...
Steve Scrimpshire Posted February 27, 2006 Report Share Posted February 27, 2006 < root /home/omar/Documents > ls -l /dev/ttyp* crw-rw---- 1 root tty 3, 0 Feb 26 11:28 /dev/ttyp0 crw-rw---- 1 root tty 3, 1 Feb 26 11:28 /dev/ttyp1 crw-rw---- 1 root tty 3, 2 Feb 26 11:28 /dev/ttyp2 crw-rw---- 1 root tty 3, 3 Feb 26 11:28 /dev/ttyp3 crw-rw---- 1 root tty 3, 4 Feb 26 11:28 /dev/ttyp4 crw-rw---- 1 root tty 3, 5 Feb 26 11:28 /dev/ttyp5 crw-rw---- 1 root tty 3, 6 Feb 26 11:28 /dev/ttyp6 crw-rw---- 1 root tty 3, 7 Feb 26 11:28 /dev/ttyp7 crw-rw---- 1 root tty 3, 8 Feb 26 11:28 /dev/ttyp8 crw-rw---- 1 root tty 3, 9 Feb 26 11:28 /dev/ttyp9 crw-rw---- 1 root tty 3, 10 Feb 26 11:28 /dev/ttypa crw-rw---- 1 root tty 3, 11 Feb 26 11:28 /dev/ttypb crw-rw---- 1 root tty 3, 12 Feb 26 11:28 /dev/ttypc crw-rw---- 1 root tty 3, 13 Feb 26 11:28 /dev/ttypd crw-rw---- 1 root tty 3, 14 Feb 26 11:28 /dev/ttype crw-rw---- 1 root tty 3, 15 Feb 26 11:28 /dev/ttypf < root /dev > ls -l pty * < root /dev > ls -l pty* crw-rw---- 1 root tty 2, 176 Feb 26 11:28 ptya0 crw-rw---- 1 root tty 2, 177 Feb 26 11:28 ptya1 crw-rw---- 1 root tty 2, 178 Feb 26 11:28 ptya2 crw-rw---- 1 root tty 2, 179 Feb 26 11:28 ptya3 crw-rw---- 1 root tty 2, 180 Feb 26 11:28 ptya4 crw-rw---- 1 root tty 2, 181 Feb 26 11:28 ptya5 crw-rw---- 1 root tty 2, 182 Feb 26 11:28 ptya6 crw-rw---- 1 root tty 2, 183 Feb 26 11:28 ptya7 crw-rw---- 1 root tty 2, 184 Feb 26 11:28 ptya8 crw-rw---- 1 root tty 2, 185 Feb 26 11:28 ptya9 crw-rw---- 1 root tty 2, 186 Feb 26 11:28 ptyaa crw-rw---- 1 root tty 2, 187 Feb 26 11:28 ptyab crw-rw---- 1 root tty 2, 188 Feb 26 11:28 ptyac crw-rw---- 1 root tty 2, 189 Feb 26 11:28 ptyad crw-rw---- 1 root tty 2, 190 Feb 26 11:28 ptyae crw-rw---- 1 root tty 2, 191 Feb 26 11:28 ptyaf crw-rw---- 1 root tty 2, 192 Feb 26 11:28 ptyb0 crw-rw---- 1 root tty 2, 193 Feb 26 11:28 ptyb1 ...<snip>.. crw-rw---- 1 root tty 2, 164 Feb 26 11:28 ptyz4 crw-rw---- 1 root tty 2, 165 Feb 26 11:28 ptyz5 crw-rw---- 1 root tty 2, 166 Feb 26 11:28 ptyz6 crw-rw---- 1 root tty 2, 167 Feb 26 11:28 ptyz7 crw-rw---- 1 root tty 2, 168 Feb 26 11:28 ptyz8 crw-rw---- 1 root tty 2, 169 Feb 26 11:28 ptyz9 crw-rw---- 1 root tty 2, 170 Feb 26 11:28 ptyza crw-rw---- 1 root tty 2, 171 Feb 26 11:28 ptyzb crw-rw---- 1 root tty 2, 172 Feb 26 11:28 ptyzc crw-rw---- 1 root tty 2, 173 Feb 26 11:28 ptyzd crw-rw---- 1 root tty 2, 174 Feb 26 11:28 ptyze crw-rw---- 1 root tty 2, 175 Feb 26 11:28 ptyzf Quote Link to comment Share on other sites More sharing options...
Bill Lewis Posted February 27, 2006 Author Report Share Posted February 27, 2006 Steve, That's how it's supposed to look. Powerpack install just ain't the same. Patrick You win. /etc/udev/rules.d/50-mdk.rules is the file that controls the pty config. I'm not really famiilar with udev but, with a basic understanding of pseudo terminals, it took all of one minute to edit the file so the system configures 256 actual devices. this gets changed: KERNEL=="tty[p-za-e][0-9a-f]*", NAME="pty/s%n", SYMLINK+="%k", GROUP="tty", OPTIONS="last_rule" KERNEL=="pty[p-za-e][0-9a-f]*", NAME="pty/m%n", SYMLINK+="%k", GROUP="tty", OPTIONS="last_rule" to this: KERNEL=="pty[pqrstuvwxyzabcdef][0123456789abcdef]", NAME="%k", GROUP="tty", MODE="666", OPTIONS="last_rule" KERNEL=="tty[pqrstuvwxyzabcdef][0123456789abcdef]", NAME="%k", GROUP="tty", MODE="666", OPTIONS="last_rule" BTW: didn't mean to slam this site in any way. Matter of fact I'll be hanging around it now that it looks like the place where the most knowledgeable people seem to be hanging out. I did a few posts on the mandriva expert site and didn't get any response at all. I'll definitely be making an issue of this pty config on the main Mandriva site. Doubt I'm the first to run into this, but maybe the first one to surface on this site. One reason I can think of is that I don't use the 'xterm' from xorg which doesn't seem to use pty's. If I did use it there wouldn't be an issue. Unfortunately that client has the most pathetic scrolling mechanism/appearance I have ever seen, and I was programming X/Motif as far back as the '80's. I've been using MetroLink Motif 'mxterm'(uses pty's) for as long as it's been in existence and up until this install I have always used their Motif window manager. Just starting to use KDE now that there happen to be a few good KDE apps available. Guess there just aren't that many old-school unix developers left anymore. We will always be a problem. Anyway, THANKS again for providing the answer I have been looking for. -bill Quote Link to comment Share on other sites More sharing options...
Steve Scrimpshire Posted February 28, 2006 Report Share Posted February 28, 2006 That's very odd. Mine looks exactly like this: KERNEL=="tty[p-za-e][0-9a-f]*", NAME="pty/s%n", SYMLINK+="%k", GROUP="tty", OPTIONS="last_rule" KERNEL=="pty[p-za-e][0-9a-f]*", NAME="pty/m%n", SYMLINK+="%k", GROUP="tty", OPTIONS="last_rule" I am intrigued now. Quote Link to comment Share on other sites More sharing options...
Bill Lewis Posted February 28, 2006 Author Report Share Posted February 28, 2006 Steve, Yeah, it's really strange. Obviously your box is not using the contents of that file to configure your pty's. I was starting to dig into the how the pty's are configured in the kernel when Patrick tipped me off to the 50-mdk.rules file. My kernel is configured to use Unix98 pty support(used pseudo term multiplexing) AND legacy pty support(which is what your box, and my now working box, are using). There is some good info on pty's in /usr/src/linux/Documentation/devices.txt. I found some weird kernel config issues where the Unix98 pty support is tied to the CONFIG_EMBEDDED var in the .config file which is enabled in the boxed Mandriva distro. This is pretty scary as there is warning in xconfig for CONFIG_EMBEDDED and it's not something that's enabled in another 2.16 distro that I am screwing around with. I decided that, for right now, I don't give a shit about how it really works as the change I made fixes my problem and I now need to install Mandriva 2006 PowerPack on 2 of my other machines. Might get back to it later. Let me know if you figure it out. LOL. -bill Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.