Bug 678715

Summary: netstat loop fixes needed
Product: [Retired] Dogtag Certificate System Reporter: John Dennis <jdennis>
Component: Installer (pkicreate/pkiremove)Assignee: Matthew Harmsen <mharmsen>
Status: CLOSED EOL QA Contact: Ben Levenson <benl>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.0CC: alee
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 679174 (view as bug list) Environment:
Last Closed: 2020-03-27 18:40:23 UTC Type: ---
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: 679174    
Attachments:
Description Flags
better netstat loop behaviour mharmsen: review+

Description John Dennis 2011-02-18 23:46:08 UTC
In the start_instance() function in file pki/base/common/scripts/functions

A loop was recently added to wait for the instance to fully initialize by using netstat to check socket availability.

There are a couple of minor problems which need fixing.

1) No check for previous status

The instance is started like this:

    $PKI_INSTANCE_INITSCRIPT start
    rv=$?

then the loop is entered. But if the initscript failed ($rv -ne 0) there is no point in looping for 30 seconds waiting for it to come up. The function should immediately return the failed error code.

2) If the loop is exhausted and no sockets were detected the function should return a failure error code.

Comment 1 John Dennis 2011-02-18 23:54:53 UTC
Created attachment 479632 [details]
better netstat loop behaviour

Comment 2 Matthew Harmsen 2011-02-22 00:31:10 UTC
TIP:

# cd pki

# svn status | grep -v ^$ | grep -v ^P | grep -v ^X | grep -v ^?
M       base/common/scripts/functions

# svn commit
Sending        base/common/scripts/functions
Transmitting file data .
Committed revision 1861.