From: Adam Sutton Date: Sat, 9 Feb 2013 12:51:14 +0000 (+0000) Subject: init: added delay option to init X-Git-Tag: v3.5~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79c134f9c401679b01d46b8857148c5457267224;p=thirdparty%2Ftvheadend.git init: added delay option to init --- diff --git a/debian/tvheadend.default b/debian/tvheadend.default index 4617c07bc..29b6dbef8 100644 --- a/debian/tvheadend.default +++ b/debian/tvheadend.default @@ -47,6 +47,10 @@ TVH_HTSP_PORT="" # if set to 1 will output debug to syslog TVH_DEBUG=0 +# TVH_DELAY +# if set startup will be delayed N seconds to allow hardware init +TVH_DELAY="" + # TVH_ARGS # add any other arguments TVH_ARGS="" diff --git a/debian/tvheadend.init b/debian/tvheadend.init index d0fb7dd73..b4aea9cbd 100644 --- a/debian/tvheadend.init +++ b/debian/tvheadend.init @@ -85,6 +85,7 @@ do_stop() case "$1" in start) [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + [ ! -z "$TVH_DELAY" ] && sleep $TVH_DELAY do_start case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; diff --git a/debian/tvheadend.upstart b/debian/tvheadend.upstart index 9fe9baf7e..a5d704045 100644 --- a/debian/tvheadend.upstart +++ b/debian/tvheadend.upstart @@ -22,11 +22,13 @@ script [ -z "$TVH_GROUP" ] || ARGS="$ARGS -g $TVH_GROUP" [ -z "$TVH_CONF_DIR" ] || ARGS="$ARGS -c $TVH_CONF_DIR" [ -z "$TVH_ADAPTERS" ] || ARGS="$ARGS -a $TVH_ADAPTERS" - [ "$TVH_IPV6" == "1" ] && ARGS="$ARGS -6" + [ "$TVH_IPV6" = "1" ] && ARGS="$ARGS -6" [ -z "$TVH_HTTP_PORT" ] || ARGS="$ARGS --http_port $TVH_HTTP_PORT" [ -z "$TVH_HTTP_ROOT" ] || ARGS="$ARGS --http_root $TVH_HTTP_ROOT" [ -z "$TVH_HTSP_PORT" ] || ARGS="$ARGS --htsp_port $TVH_HTSP_PORT" [ "$TVH_DEBUG" = "1" ] && ARGS="$ARGS -s" + [ ! -z "$TVH_DELAY" ] && sleep $TVH_DELAY + exec tvheadend $ARGS $TVH_ARGS end script