wrappercheck: configurable sleep after daemon launch

When output checking isn't possible, allow sleeping for a configurable
amount of time.
This commit is contained in:
Patrick Ohly 2014-10-24 07:02:17 -07:00
parent c2dd6033ed
commit 18d301b37c
1 changed files with 8 additions and 0 deletions

View File

@ -33,6 +33,10 @@ while [ $# -gt 1 ] && [ "$1" != "--" ] ; do
shift
WAIT_FOR_DAEMON_OUTPUT="$1"
;;
--daemon-sleep)
shift
DAEMON_SLEEP="$1"
;;
*=*)
ENV[${#ENV[*]}]="$1"
;;
@ -67,6 +71,10 @@ fi
if kill -0 $BACKGROUND_PID 2>/dev/null; then
set +e
if [ "$DAEMON_SLEEP" ]; then
( set +x; echo >&2 "*** 'sleep $DAEMON_SLEEP' for daemon to settle down" )
sleep $DAEMON_SLEEP
fi
(set -x; "$@")
RET=$?
set -e