From: OLIVOTTO%ITNCISCA.bitnet@icineca.cineca.it (OUT, OUT - YOU'LL NOT FEEL THE FALL-OUT...)
Newsgroups: comp.unix.wizards
Subject: (From: IN%"UNIX-WIZARDS@BRL.MIL") UNIX-WIZARDS Digest  V16#033
Date: 10 Oct 92 05:26:31 GMT

UNIX-WIZARDS Digest          Fri, 09 Oct 1992              V16#033

Today's Topics:
                          AIX kernel namelist
                   Re: Inodes in short supply.  Why?
                        fork() and forget..How?
                 Re: Strange Output from 'netstat -a'.
                           Re: Disk leakage?
                   *** I NEED HELP WITH YACC !!! ***

-----------------------------------------------------------------

From: Robert Ingram <ingram@cs.duke.edu>
Subject: AIX kernel namelist
Keywords: kernel, namelist, rwhod
Date: 1 Oct 92 13:30:45 GMT
Followup-To: poster
To:       unix-wizards@sem.brl.mil

What variables from the kernel's name list does the rwhod daemon
reference?  I am attempting to run a locally modified version of the
rwhod daemon on an RS6000 under AIX 3.2.2. However, the daemon was
previously run on only Sun & DEC platforms; the variables that it
references do not exist in the AIX kernel! So far, "educated guesses"
have proved fruitless. I need to know specifically which variables the
rwhod daemon looks for, or at least a reliable way to find out.

Please reply via e-mail, as this question is of rather limited
interest to the general public.
---
--
Department of Computer Science, Duke University, Durham, NC 27706
Internet:       ingram@cs.duke.edu    (Robert Ingram)
UUCP:           mcnc!duke!ingram

-----------------------------

From: John Haxby <jch@rdg.dec.com>
Subject: Re: Inodes in short supply.  Why?
Keywords: inodes,lack,thereof
Date: 6 Oct 92 11:40:06 GMT
To:       unix-wizards@sem.brl.mil

Typically, to get the number of inodes up enough you'll need
to reduce the number of cylinders per cylinder group.  We run
with 8 cylinders per cylinder group instead of the normal 16 on
our news disk to get enough inodes.

--
John Haxby, Definitively Wrong.
Digital                         <jch@rdg.dec.com>
Reading, England                <...!uknet!wessex!jch>

 ----------------------------------------------------------------
The opinions expressed herein are my own, not my employers.

-----------------------------

From: "R. Kirk Waterhouse" <kirk@ctms.gwinnett.com>
Subject: fork() and forget..How?
Keywords: fork() wait() getpid() getppid()
Date: 7 Oct 92 19:40:20 GMT
Followup-To: comp.unix.wizards
To:       unix-wizards@sem.brl.mil


I am looking for a way to fork() a process and forget about it.

Here is the scenario:

I have a process that is constantly reading data from another process.
My process has been popen()'ed from this other process, so I have the 5120 byte
buffer from the pipe which allows me to do the necessary processing on the data.
My process is basicly queing up data to send to another process.

This other process is my problem.

I need to have multiple instantiations of this process running in the
 backgroundto act as multiple channels. However, I want to send a batch of data
 to this
other process, allow it to process this batch and die off when through, while my
current process is still recieving data from the process that is feeding it.

Wow!, did I say that right?  Yea, see picture below.

 -----------     P      ----------- fork()---> Channel 3 }  These are not so
 much
|  Main   | --->I      |   My    | fork()---> Channel 2 }  channels, as they are
| Process |     P ---> | Process | fork()---> Channel 4 }  independtly running
 -----------     E      ----------- fork()---> Channel 1 }  processes that die
                                   fork()---> Channel x }  when complete.

I followed the examples in the AT&T Programmers Guide and other books and they
won't quite work.

   if (fork()) {
      if(child) {
         ...
         process_data_and_die();
         exit(1);
      }
      else
      if (parent) {
         wait()
      }
   }

If I do it basicly like this I only get one instantiation of my child process
because the parent sits there at the wait, losing data from it's input because
this child takes approx. 1-2 minutes to complete.

If I leave out the wait, I get hundreds of instantiations of my child process
which become zombie processes with a parent of (1 or init) until I can issue
a wait().  (When could I issue a wait()?)  At this point I loose data again from
my input process until all of these zombie processes get cleared up. (If I do
not issue the wait or kill my process, I soon cannot fork() anymore, I guess I
am exceeding the maxixmum number of processes)

Any body got any ideas? This is the first time I have used fork(), is there
something basic I am missing?

At this point (until I figure out the fork()'s) I am just running my child
process in the background and opening up an IPC FIFO between us and having to
know in advance how many channels I will need so I can open up that many FIFOs.

This works, but there seems to be alot more overhead involved with the FIFOs
than would be with the fork()'s. The fork() would also be alot more flexible
since it would allow as many channels as needed, and I could regulate how many
would run as a maximum rather than having to run x number of background
processes and open x number of FIFOs.

Any insight to this problem will be greatly appreciated!
Thanks (ALOT) in advance,
R. Kirk Waterhouse

P.S.
Just in case this is important, I am running AT&T Sys V rel 3.2.2 on a 386 w/
4 meg of ram, and AT&T's C-compiler.

--
 kirk@ctms.gwinnett.com            |  R. Kirk Waterhouse    DoD# 0626    KD4NKD
                                   |     It was one of those nights
 if (opinions != employer)         |     when you turn out the lights
    must_be(mine);                 |     and everything comes into view - AC/DC

-----------------------------

From: Robin Pickering <rob@icarus.inmos.co.uk>
Subject: Re: Strange Output from 'netstat -a'.
Date: 8 Oct 92 14:04:50 GMT
To:       unix-wizards@sem.brl.mil

In article <1992Oct8.100932.18923@pony.Ingres.COM> mikeg@Ingres.COM (Mike
 Glendinning) writes:
>I did a 'netstat -a' command on a SVR4 box the other day, and it
>came up with this strange (and worrying) output.

Unless netstat on SVR4 is implemented very differently than BSD, beware
of believing it's output on a moderately loaded machine.

Netstat (and others such as ps) have to go trunking
round the contents of /dev/kmem to get their information, and as user processes
have no way of maintaining locks on the data. This means that data structures
can be moved round between say sucessive reads of a linked list, leading to
garbage being read. This could well be the source of your worying output.

--
   Rob.

-----------------------------

From: Albert Cheng <acheng@ncsa.uiuc.edu>
Subject: Re: Disk leakage?
Date: 8 Oct 92 17:25:58 GMT
Originator: acheng@shalom.ncsa.uiuc.edu
To:       unix-wizards@sem.brl.mil


In article <1992Oct8.095328.4108@bristol.ac.uk>, smee@bristol.ac.uk (Paul Smee)
 writes:
>We've got a mystery, in that large (in our context) chunks of disk
>occasionally mysteriously vanish, to reappear if you reboot.  I believe
>I understand the mechanism, question is a bit deeper than that.
>
>My current theory is that the space is 'vanishing' owing to files which
>have been removed from the directory hierarchy, but which are still
>being held in existence because someone still has them open, so keeping
>the inode's refcount from zeroing.  Sounds reasonable, Unix does that.

Yes, I have encounter similar problems before.  The following is an
illustration:

        dd if=/dev/zero of=/tmp/junk bs=100b count=100  #created a 5MB file
        sleep 10000 < /tmp/junk &                       #sleep keeps it used
        rm /tmp/junk
        df /tmp                                         #5MB is missing

>Question is, anyone have any magic which would aid in determining which
>process(es) still hold the files, or (less useful, but also less
>likely) even which files they were while they still were attached to
>directories, from which I could probably make reasonable guesses
>about who was using them?

Try "pstat -i" which shows all inodes in use, together with the sizes,
UID, etc.  Then use "ps axl" to get a list of processes of the same UID
for further investigation.  But I don't know of a simple tool to find
the PID(s) that reference the inode.  Any suggestions from real
wizards?

-----------------------------

From: Rune Winsevik <runewi@alkymi.unit.no>
Subject: *** I NEED HELP WITH YACC !!! ***
Keywords: yacc lex
Date: 8 Oct 92 18:49:53 GMT
To:       unix-wizards@sem.brl.mil

Hi.

Is there any yacc-gurus out there?
Could anybody please help me out?
I just can't get yacc to accept this yacc descripition. I KNOW the problem
is somewhere in the "ADigP1_4" part (or isn't it....:-)....

A helping hand would be greatly appreciated!!!!!!!

-Rune









/************************************************************************/
/*                                                                      */
/*                      YACC part of the evaluator                      */
/*                                                                      */
/************************************************************************/

%token          SBS_BUSY SBS_NO SBS_SEIZED PRIV_CALL
%token          CONV M_KEY END_CONV SBS_FREE CALL_BUSY
%token          C_KEY DIGIT INTEGER SBSNUM NL ENDS


%%

Sessions        : Sessions Session
                |
                ;

Session         : ABSession                     /* A Calls B            */
                | ENDS                          /* END-token detected. Stop
   */
                {
                  printf("End detected!\n");
                  exit(0);
                }
                ;

/*----------------------------------------------- The A-Calls-B session */

ABSession       :  ADigP1_4 _ASBSNum ANumB

                {
                  if($1==$2)
                  {
                    printf("\n*** Complete ABSession detected ***\n\n");
                  }
                  else
                  {
                    printf("A Fetched wrong number!!!! %d != %d\n\n",$1,$2);
                    exit(0);
                  }
                }

                ;

ANumB           : _CallBusy _SBSFree            /* B is busy. Hang up?  */
                | _PrivCall _Conv EndSession    /* Private call         */
                | _Conv EndSession              /* Normal call          */
                ;

EndSession      : _CKey _EndConv _SBSFree       /* A presses C_KEY      */
                ;
ADigP1_4        : _ADigP _ABusy
                {
                  $$ = $1;
                }
                | _ADigP _ABusy _ADigP
                {
                  $$ = 10*$1 + $3;
                }
                | _ADigP _ABusy _ADigP _ADigP
                {
                  $$ = 100*$1 + 10*$3 + $4;
                }
                | _ADigP _ABusy _ADigP _ADigP _ADigP
                {
                  $$ = 1000*$1 + 100*$3 + 10*$4 + $5;
                }
                ;



_ADigP          : SBSNUM DIGIT INTEGER NL       /* A pressed a digit    */
                {
                  $$ = $3;
                  printf("%d trykket paa '%d'\n",$1,$3);
                }
                ;

_ABusy          : SBSNUM SBS_BUSY NL
                ;

_ASBSNum        : SBSNUM SBS_NO SBSNUM NL
                {
                  $$ = $3;
                  printf("SBS-num = %d\n",$3);
                }
                ;

_CallBusy       : SBSNUM CALL_BUSY SBSNUM NL
                ;

_SBSFree        : SBSNUM SBS_FREE NL
                ;

_PrivCall       : SBSNUM PRIV_CALL SBSNUM NL
                ;

_Conv           : SBSNUM CONV SBSNUM NL
                ;

_CKey           : SBSNUM C_KEY NL
                ;

_MKey           : SBSNUM M_KEY NL
                ;

_EndConv        : SBSNUM END_CONV SBSNUM NL
                ;

%%


#include "lex.yy.c"

-----------------------------


End of UNIX-WIZARDS Digest
**************************
Newsgroups: comp.unix.wizards