Bug 1383661

Summary: Output not always logged
Product: [Community] Spacewalk Reporter: jochen
Component: ClientsAssignee: Michael Mráka <mmraka>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 2.5   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-07-12 11:21:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description jochen 2016-10-11 11:43:50 UTC
Description of problem:

If the last read request returns an empty string, the command output is not getting logged.

Bug is around line 462 of rhnsd.c:


		ret = waitpid(child, &retval, WNOHANG);
		if (ret == child) {
		    /* huh, status changed, we're done */
		    if (strlen(buffer) > 0)
			syslog(LOG_INFO, "%s returned: %s", RHN_CHECK, buf);
		    free(buf);
                    close(fds[0]); /* plug in fd leak */


Instead of:

if (strlen(buffer) > 0)

this should be:

if (strlen(buf) > 0)

Comment 1 Michael Mráka 2019-07-12 11:21:42 UTC
In current version of Spacewalk 2.9 rhnsd has been replaced by systemd timer.