Networker

Re: [Networker] Can't get nsradmin to work via Perl script

2006-04-28 12:06:17
Subject: Re: [Networker] Can't get nsradmin to work via Perl script
From: Tim Mooney <mooney AT DOGBERT.CC.NDSU.NODAK DOT EDU>
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Date: Fri, 28 Apr 2006 10:59:34 -0500
In regard to: Re: [Networker] Can't get nsradmin to work via Perl script,...:

Well, getting rid of the 'waitpid' command fixed its little wagon, and no, I have no idea why I was waiting.

Because that's probably what the example you looked at did, since it's
the right thing to do in a longer-running process.  Without it, in a
longer-running process you'll almost certainly end up with zombies.

As Darren correctly pointed out, the problem wasn't the waitpid, is was
that you were calling waitpid before you were done interacting with the
child.  The waitpid() should be after a close(RDRFH), which would be after
your array slurp.

Tim

   close (WTRFH);

waitpid($pid, 0);


Why are you waiting on a process that you're not done interacting with?
For this short of a program, you probably shouldn't wait on it at all.
While I'd expect problems with a longer program, I wouldn't think that
what you're doing would be affected.  Still I'd get rid of that line.


# get the results.
my @output = <RDRFH>;

print @output;





To sign off this list, send email to listserv AT listserv.temple DOT edu and type "signoff networker" in the body of the email. Please write to networker-request AT listserv.temple DOT edu if you have any problems wit this list. You can access the archives at http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER


--
Tim Mooney                              mooney AT dogbert.cc.ndsu.NoDak DOT edu
Information Technology Services         (701) 231-1076 (Voice)
Room 242-J6, IACC Building              (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164

To sign off this list, send email to listserv AT listserv.temple DOT edu and type 
"signoff networker" in the
body of the email. Please write to networker-request AT listserv.temple DOT edu 
if you have any problems
wit this list. You can access the archives at 
http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER

<Prev in Thread] Current Thread [Next in Thread>