CVSROOT:        /cvs
Module name:    src
Changes by:     [email protected]       2011/06/10 02:43:26

Modified files:
        etc/rc.d       : rc.subr 

Log message:
Finally deal with background processes: "rc_cmd start" will now return
the correct code according whether the daemon did start successfully or
not.

rc_wait()
This function has been extended, first we need to pass in which mode we
are running (start or stop) and second we can pass a number of seconds
to wait (optionnal, will default to 30s).
The function will return the correct code whether we are running during
"rc_cmd start" or "rc_cmd stop".

rc_cmd() start
If we are running in background mode, then we call rc_wait with the
"start" argument.
The sleep(1) is needed to prevent a race condition where the process
will appear in the list before failing and rc_check will see it as
running. Call rc_post() when failing to prevent being left in an
inconsistent state (because rc_pre() would have run successfully)

rc_cmd() stop
We are now calling rc_wait with the "stop" argument.

"looks good" sthen@, ok robert@

Reply via email to