Bug 1401694

Summary: rotatelogs: creation of zombie processes when -p is used
Product: Red Hat Enterprise Linux 6 Reporter: Robert Bost <rbost>
Component: httpdAssignee: Luboš Uhliarik <luhliari>
Status: CLOSED ERRATA QA Contact: Jan Houska <jhouska>
Severity: high Docs Contact:
Priority: urgent    
Version: 6.8CC: bnater, dmasirka, jorton, luhliari
Target Milestone: rcKeywords: Patch, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: httpd-2.2.15-59.el6 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1403212 1451333 (view as bug list) Environment:
Last Closed: 2017-03-21 11:51:03 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:
Bug Depends On:    
Bug Blocks: 1403212, 1451333    

Description Robert Bost 2016-12-05 20:29:33 UTC
Description of problem: Rotatelogs creates zombie processes for program specified in -p flag


Version-Release number of selected component (if applicable): httpd-2.2.15-55.el6_8.2.x86_64


How reproducible: Always


Steps to Reproduce:
Change ErrorLog directive to use rotatelogs command with -p flag. For example:

  ErrorLog "|/usr/sbin/rotatelogs -l -p /bin/gzip -f -L /var/log/httpd/error_log /tmp/error%h 100B"


Actual results: Results in defunct/zombie gzip process

Additional info: The problem appears to be addressed in Apache 2.4.10 :
*) rotatelogs: Avoid creation of zombie processes when -p is used on
Unix platforms. [Joe Orton]
http://archive.apache.org/dist/httpd/CHANGES_2.4.10

Comment 9 Jan Houska 2016-12-19 12:09:28 UTC
Verified:

Old Fail:
:: [   LOG    ] :: Installed:    : httpd-2.2.15-55.el6_8.2.x86_64 

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [  BEGIN   ] :: Looking for possible running gzip proces. :: actually running 'ps -A | grep 'gzip' | tee output1.log'
:: [   PASS   ] :: Looking for possible running gzip proces. (Expected 1, got 1)
:: [   PASS   ] :: File 'output1.log' should not contain 'gzip' 
:: [  BEGIN   ] :: Restarting httpd :: actually running 'httpStart'
httpd is stopped
:: [  BEGIN   ] :: Disabling mod_ssl and mod_nss :: actually running 'httpDisableMod ssl nss'
:: [  BEGIN   ] :: Disabling /etc/httpd/conf.d/ssl.conf :: actually running 'mv /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf.disabled'
:: [   PASS   ] :: Disabling /etc/httpd/conf.d/ssl.conf (Expected 0, got 0)
:: [   PASS   ] :: Disabling mod_ssl and mod_nss (Expected 0, got 0)
:: [  BEGIN   ] :: starting httpd service :: actually running 'rlServiceStart httpd'
httpd is stopped
Starting httpd: gzip: /var/log/httpd/errorX.1481897780 has 1 other link  -- unchanged
[  OK  ]
:: [ 14:16:20 ] :: rlServiceStart: Service httpd started successfully
:: [   PASS   ] :: starting httpd service (Expected 0, got 0)
:: [  BEGIN   ] :: Creating test file :: actually running 'echo 'ok' > /var/www/html/http_testfile'
:: [   PASS   ] :: Creating test file (Expected 0, got 0)
:: [   PASS   ] :: Restarting httpd (Expected 0, got 0)
:: [  BEGIN   ] :: Looking for possible running gzip proces. :: actually running 'ps -A | grep 'gzip' | tee output2.log'
31183 ?        00:00:00 gzip <defunct>
:: [   FAIL   ] :: Looking for possible running gzip proces. (Expected 1, got 0)
:: [   FAIL   ] :: File 'output2.log' should not contain 'gzip' 
31183 ?        00:00:00 gzip <defunct>
'89ec0eda-b609-4fb6-b3e9-179e944b045d'
Test result: FAIL
   metric: 2
   Log: /var/tmp/beakerlib-49194282/journal.txt
    Info: Searching AVC errors produced since 1481915779.82 (Fri Dec 16 14:16:19 2016)
     Searching logs...
     Info: No AVC messages found.
 Writing to /mnt/testarea/tmp.6k1WtR
:
   AvcLog: /mnt/testarea/tmp.6k1WtR


New Pass:
:: [   LOG    ] :: Installed:    : httpd-2.2.15-59.el6.x86_64 

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [  BEGIN   ] :: Looking for possible running gzip proces. :: actually running 'ps -A | grep 'gzip' | tee output1.log'
:: [   PASS   ] :: Looking for possible running gzip proces. (Expected 1, got 1)
:: [   PASS   ] :: File 'output1.log' should not contain 'gzip' 
:: [  BEGIN   ] :: Restarting httpd :: actually running 'httpStart'
httpd is stopped
:: [  BEGIN   ] :: Disabling mod_ssl and mod_nss :: actually running 'httpDisableMod ssl nss'
:: [  BEGIN   ] :: Disabling /etc/httpd/conf.d/ssl.conf :: actually running 'mv /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf.disabled'
:: [   PASS   ] :: Disabling /etc/httpd/conf.d/ssl.conf (Expected 0, got 0)
:: [   PASS   ] :: Disabling mod_ssl and mod_nss (Expected 0, got 0)
:: [  BEGIN   ] :: starting httpd service :: actually running 'rlServiceStart httpd'
httpd is stopped
Starting httpd: gzip: /var/log/httpd/errorX.1481897909 has 1 other link  -- unchanged
[  OK  ]
:: [ 14:18:29 ] :: rlServiceStart: Service httpd started successfully
:: [   PASS   ] :: starting httpd service (Expected 0, got 0)
:: [  BEGIN   ] :: Creating test file :: actually running 'echo 'ok' > /var/www/html/http_testfile'
:: [   PASS   ] :: Creating test file (Expected 0, got 0)
:: [   PASS   ] :: Restarting httpd (Expected 0, got 0)
:: [  BEGIN   ] :: Looking for possible running gzip proces. :: actually running 'ps -A | grep 'gzip' | tee output2.log'
:: [   PASS   ] :: Looking for possible running gzip proces. (Expected 1, got 1)
:: [   PASS   ] :: File 'output2.log' should not contain 'gzip' 
'08dc1248-1dce-4260-94e6-12158215ebbb'
Test result: PASS
   metric: 0
   Log: /var/tmp/beakerlib-49194284/journal.txt
    Info: Searching AVC errors produced since 1481915909.16 (Fri Dec 16 14:18:29 2016)
     Searching logs...
     Info: No AVC messages found.
 Writing to /mnt/testarea/tmp.sNdA5Z
:
   AvcLog: /mnt/testarea/tmp.sNdA5Z

Comment 11 errata-xmlrpc 2017-03-21 11:51:03 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2017-0784.html