home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!newsgate.watson.ibm.com!yktnews!admin!florida!essbaum
- From: essbaum@rchland.vnet.ibm.com (Alexander Essbaum)
- Subject: can't get pid
- Sender: news@rchland.ibm.com
- Message-ID: <1992Dec29.164941.21995@rchland.ibm.com>
- Date: Tue, 29 Dec 1992 16:49:41 GMT
- Disclaimer: This posting represents the poster's views, not necessarily those of IBM
- Nntp-Posting-Host: florida.rchland.ibm.com
- Organization: IBM Rochester
- Lines: 44
-
- hi. hopefully this will make sense:
-
- i'm trying to wait for a process called from inside perl via
-
- open (apl2,"$apl2command|");
-
- or
-
- `$apl2command`;
-
-
- $apl2command calls a ksh script that executes an apl2 interpreter with
- some parameters. problem is, it seems the shell that calls the apl2 command
- exits immediately even though the apl2 command takes 1 minute to run.
-
- if i do
-
- $apl2id = open (apl2,"$apl2command|");
- print `ps -fp $apl2id`;
- waitpid ($apl2id,0);
-
- i get
-
- USER PID PPID C STIME TTY TIME CMD
- essbaum 21931 17054 16 0:00 <defunct>
-
- and the shell that "$apl2command" ran in seems to go away (no "waiting").
-
- while this is running, i can see (via ps alx) that the process i REALLY
- want to wait for is created and its parent is another process who's PPID
- is 1. apparently the shell from "open" goes away and the ksh that runs
- apl2 gets adopted by init. does this make sense? any idea what might
- cause this or how i can stop it?
-
- basically, i need to wait for the apl2 process to finish before i go on,
- but i can't seem to get my hands on the PID of that process. i'd rather
- not use ps and try to guess which process is the right one... (there could
- be multiple apl2 processes, etc. i'd have to look at times and stuff.
- yuk. )
-
- thanks in advance for any help!
-
- axel
-
-