Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Pseudo terminal causing LM to die w/ fatal error

2 views
Skip to first unread message

CJ

unread,
Oct 16, 2007, 8:11:01 PM10/16/07
to
A SCO 5.0.5 customer reports to me that and new utility I created that
uses pseudo terminals is causing the license manager to "blow up" and
die with a fatal error to the console. They are unable to "capture"
the exact LM fatal message written only to the system console.

Does anyone know if use of pseudo terminals can violate the number of
users license on a SCO 5.0.5 system?

cj

jbo...@sco.com

unread,
Oct 17, 2007, 3:56:17 AM10/17/07
to

Difficult to say what the problem is here. You need to be more
specific about
the license manager and how it "blows up" to say for sure what is
happening.
For general help on debugging license failures on old releases of
OpenServer see:

http://www.sco.com/ta/104851

John

mbennett

unread,
Oct 17, 2007, 11:05:48 AM10/17/07
to

It's possible you have an inadequate number of pseudo ttys defined.
That will create all kinds of odd errors in strange places. Check /
var/adm/syslog for errors, or just run 'netconfig' and double the
number of pseudo ttys. Highlight your TCP/IP connection, then select
Protocol | Modify. The default number is 64 and you can really goose
it without any harm other than possibly having a bunch of unused
device entries. I think I'd increase it to 256. You will need to re-
link and reboot when you do this.

Mark

CJ

unread,
Oct 19, 2007, 4:34:03 PM10/19/07
to
On Oct 17, 11:05 am, mbennett <mbenn...@claritysoftwaresystems.com>
wrote:

Thanks, Mark. The system is already configured for 524 pseudo
terminals. The application I created uses UNIX Domain Sockets as
well, which may also conflict with the policy manager if all UDS's are
consumed. However, the system is configured for 32 UNIX Domain
Sockets, and the max in use when my application is run is 16. My app
only uses 1 UDS, so I doubt that is the conflict.

However, I have learned that the failure is isolated to the SCO Bourne
shell (sh) when run from a while/do/done loop that is reading from a
redirected input file, example follows. Pty is basically an
implementation Richard Steven's forkpty() method.

#!/bin/sh
while read VAR
do
pty command_line_arguments
done < some_file

The above will cause the either the policy manager or the license
manager "crash", requiring a reboot from the system console, all IP
services are disabled.

However, if I change the above script to a for/do/done loop, the pty
command does not affect the LM/PM, and the symptoms simply go away.

#!/bin/sh
for VAR in `cat some_file`
do
pty command_line_arguments
done

And, the really odd thing is, if I change to the Korn shell in the
first script, the symptoms disappear and LM/PM do not crash.

#!/bin/ksh
while read VAR
do
pty command_line_arguments
done

The above script works fine under the Korn shell, using a for/do/done
loop in the Bourne shell works fine, but if I use a while/do/done to
run my pty application in a Bourne shell the LM/PM crashes every time.

I am lost as to why.

cj

Bill Vermillion

unread,
Oct 20, 2007, 10:14:02 AM10/20/07
to
In article <1192817449.7...@t8g2000prg.googlegroups.com>,

Reading the ksh93 man page [the only one I have current access to]
there is a difference in wording between the 'while' and 'for'
commands.

In the 'for' command is says "Each time a for command is executed,
the vname is set to the next word taken from the word list"

The 'while' command says "A while command repeatedly executes
the while list and, if the exit status of the last command is zero
it executes the do list; otherwise the loop terminates .."

That is not really specific but as I read between the lines
the 'for' just goes through the list one line at a time and
the 'while' looks at the whole list.

Would you interpret that the same way?

And have you tried the 'for' without the 'cat' command. That seems
extraneous to me.

Bill
--
Bill Vermillion - bv @ wjv . com

CJ

unread,
Oct 20, 2007, 7:35:36 PM10/20/07
to
On Oct 20, 10:14 am, b...@wjv.com (Bill Vermillion) wrote:
> In article <1192817449.773545.326...@t8g2000prg.googlegroups.com>,

Thanks Bill. It appears that a while/do/done loop under the SCO
Bourne shell -- sh -- actually forks() a child process, but the Korn
shell does not. My pty application closes stdin's fileno and opens "/
dev/tty" -- the 'self' tty device specifically to prevent pipe
redirection, forcing a user to type in a sign on from the keyboard. I
"suspect" when pty closes stdin's file handle, the sh created
terminates in such a way that it's login.sco abends, resulting in the
LM/PM "blowing up" -- the best description I can provide.

I realize I have provided little to go on and am hoping someone might
have run across this issue in the past.

cj

ThreeStar

unread,
Oct 23, 2007, 1:38:37 PM10/23/07
to

It's not just a SCO-ism that the Bourne shell executes "while" loops
in a child process. Therefore changing input/output streams within
one has all sorts of strange and wonderful effects. You will see
discussion of this point in *ix literature.

I would re-do it or just accept that it runs on some platforms on some
shells.

--RLR


CJ

unread,
Oct 25, 2007, 7:21:29 AM10/25/07
to
On Oct 20, 10:14 am, b...@wjv.com (Bill Vermillion) wrote:
> In article <1192817449.773545.326...@t8g2000prg.googlegroups.com>,
>
>
>

Previous in 'the script' a file was created containing the 'tokens' to
pass to "read" command on a "while," or the VNAME variable in a
"for." In the example "for VAR in `cat somefile`" the shell expands
each token in "somefile" as arguments to "for VAR in" providing the
same affect as "while read VAR <somefile"

cj

0 new messages