Pseudo-Terminal Allocation Before Solaris 8

My brother was having some problems with his Solaris 7 systems running out of pty's. We managed another workaround that enabled him to login and sort things out (which I might discuss later), but he'd been searching the web for information on this and turned up www.xegypt.net/articles/os/ptys.txt. I'm going to quote part of the page, but before I do, Let me say this right now, ...

DO NOT DO THIS. IT IS RISKY, WRONG AND YOU COULD PANIC YOUR SYSTEM.

The riskier way, and which I have personally confirmed to be working is done on-the-fly by writing symbols in the kernel image. Advantage? You don't have to reboot. As root, type this:

#adb -k -w /dev/ksyms /dev/mem
pt_cnt/W80
npty/W80 
$q 

The problem with doing this is that Solaris uses the boot-time values to allocate various structures associated with ptys, including a number of arrays (ptms_tty[] and pty_softc[]). If we change pt_cnt and/or npty on the fly, we risk working with memory beyond what was allocated to these arrays.

At best it will write over some data that we aren't using. At worst we could panic the box by writing to unmapped memory, or worse again, we could silently modify data associated with another part of the kernel.

The only way to increase the number of ptys on Solaris 7 and earlier involves a reboot and is the first method that he recommended.

The more reliable way to do this is to append the following two lines in /etc/system and rebooting:

set npty=128
set pt_cnt=128

The issue went away with Solaris 8, at that point pty allocation became dynamic.

Technorati Tag:

Comments:

Post a Comment:
Comments are closed for this entry.
About

* - Solaris and Network Domain, Technical Support Centre


Alan is a kernel and performance engineer based in Australia who tends to have the nasty calls gravitate towards him

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today
Links
Blogroll

No bookmarks in folder

Sun Folk

No bookmarks in folder

Non-Sun Folk
Non-Sun Folks

No bookmarks in folder