[Spacewalk-list] Spacewalk 1.5 Monitoring issue

Jan Pazdziora jpazdziora at redhat.com
Thu Aug 11 08:30:48 UTC 2011


On Thu, Aug 04, 2011 at 04:40:00PM +0100, David Nutter wrote:
>  
> > What seems to be happening on the scheduler is the command's STDOUT is
> > getting written to the logfile and not read by Unix::read_result. In
> > the first trace you can see this in the last two log lines:
> > 
> > 2011-08-04 12:31:44  Linux#2.6.18-238.12.1.el5xen#2834
> > 2011-08-04 12:31:44  NOCPULSE-1312457503-STATUS 0
> 
> Got it. At long last. We're being bitten by this perl bug:
> 
> https://rt.perl.org/rt3/Public/Bug/Display.html?id=66224
> 
> The test script there does indeed fail on my CentOS 5.6 system.
> 
> Reason is that Process.pm redirects STDOUT and STDERR before spawning
> the probe runner. Then, the STDOUT of any subsequent processes
> (e.g. those started by open3 in Unix.pm) ends up going to STDOUT, not
> the IO::Handle created for it to write to. 
> 
> I believe rhn-runprobe doesn't exhibit the problem because it doesn't
> use Process.pm just calls the ProbeRunner directly.
> 
> Anyway, applying the patch below from the perl bug report does indeed fix
> the problem on my spacewalk. All probes now update in the web UI and
> appear to be recording data. 
> 
> --- Open3.pm.~1~        2005-03-19 18:43:52.000000000 +0100
> +++ Open3.pm    2010-04-29 10:30:54.000000000 +0200
> @@ -200,6 +200,9 @@
>         # A tie in the parent should not be allowed to cause problems.
>         untie *STDIN;
>         untie *STDOUT;
> +        open(STDOUT, ">&=1");
> +        open(STDERR, ">&=2");
> +
>         # If she wants to dup the kid's stderr onto her stdout I need
> 	to
>         # save a copy of her stdout before I put something else there.
>         if ($dad_rdr ne $dad_err && $dup_err
> 
> Question is, do I file a bug against RHEL5 or look at rewriting the
> logic in UnixCommand.pm to work around the issue? I hardly think that
> patching core perl modules is a sensible thing to do on a production server!  

David,

thank for the awesome investigation.

While there is a problem in IPC::Open3, it did not affect previous
Spacewalk versions, so I digged around some more and I believe I
caused it with my past commit.

Could you please apply

	http://git.fedorahosted.org/git/?p=spacewalk.git;a=commitdiff;h=32073ab4de72201e79ba587ee268ca0888247587

to see if it fixes the problem on your Spacewalk?

-- 
Jan Pazdziora
Principal Software Engineer, Satellite Engineering, Red Hat




More information about the Spacewalk-list mailing list