Bug 215562 - service script shutdown functions have sleep statements - check status instead
service script shutdown functions have sleep statements - check status instead
Status: CLOSED DEFERRED
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: conga (Show other bugs)
5.0
All Linux
low Severity low
: ---
: ---
Assigned To: Stanko Kupcevic
Corey Marthaler
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-11-14 12:18 EST by Len DiMaggio
Modified: 2009-04-16 18:55 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-12-12 10:36:55 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Len DiMaggio 2006-11-14 12:18:33 EST
Description of problem:
Service script shutdown functions have sleep statements - check status instead

I noticed this while debugging SElinux policy issues and was stopping/starting
the riccis service. The shutdown seemed to stall and I thought there might be
another problem. The cause was an 8 second sleep statement in the shutdown
function of the ricci service script. (The ricci process is killed and then the
script sleeps before deleting the PID files to make sure that all threads have
stopped.)

It's probably safe to reduce the sleep to 3-4 seconds, but why not remove it
altogether and replace it with a loop that sleeps for a second, checks if the
process is running, and then deletes the PID files.

Version-Release number of selected component (if applicable):
ricci-0.8-23.el5

How reproducible:
100%

Steps to Reproduce:
1. Stop the service.

Actual results:
Sleeps for 8 seconds

Expected results:
It could vary depending on system speed/load.



Additional info:
Comment 1 Stanko Kupcevic 2006-11-14 12:55:53 EST
TCP, by RFC, keeps server socket open until TCP timeout elapses (couple
seconds), so it can handle astrayed incoming messages. Restarts were failing
because of it (it was not enough to check if daemon was still running - new
daemon wasn't able to bind a socket even after old daemon has exited). 

SO_REUSEADDR allows port to be reused before timeout has elapsed. 

Since that has been fixed long time ago, timeouts can go as well (except for
threads to exit, which can be checked in status loop). 
Comment 2 Jim Parsons 2006-12-12 10:36:55 EST
This request is being deferred until the next version. It is a low priority fix.
Things are working ok the way they are.

Note You need to log in before you can comment on or make changes to this bug.