Red Hat Bugzilla – Bug 215562
service script shutdown functions have sleep statements - check status instead
Last modified: 2009-04-16 18:55:21 EDT
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
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):
Steps to Reproduce:
1. Stop the service.
Sleeps for 8 seconds
It could vary depending on system speed/load.
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).
This request is being deferred until the next version. It is a low priority fix.
Things are working ok the way they are.