X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=cirros-testvm%2Fsrc-cirros%2Fbuildroot-2015.05%2Fpackage%2Ftvheadend%2FS99tvheadend;fp=cirros-testvm%2Fsrc-cirros%2Fbuildroot-2015.05%2Fpackage%2Ftvheadend%2FS99tvheadend;h=75b66f37f27c0a8050452bdf55f26bc01348f01b;hb=b0a0f15dfaa205161a7fcb20cf1b8cd4948c2ef3;hp=0000000000000000000000000000000000000000;hpb=c6ac3cd55ee2da956195eee393b0882105dfad4e;p=packages%2Ftrusty%2Fcirros-testvm.git diff --git a/cirros-testvm/src-cirros/buildroot-2015.05/package/tvheadend/S99tvheadend b/cirros-testvm/src-cirros/buildroot-2015.05/package/tvheadend/S99tvheadend new file mode 100644 index 0000000..75b66f3 --- /dev/null +++ b/cirros-testvm/src-cirros/buildroot-2015.05/package/tvheadend/S99tvheadend @@ -0,0 +1,54 @@ +#! /bin/sh +# tvheadend startup script inspired by the Debian one in the package + +# Author: Yann E. MORIN + +PATH=/usr/sbin:/usr/bin:/sbin:/bin +NAME=tvheadend +DAEMON=/usr/bin/$NAME +PIDFILE=/var/run/$NAME.pid + +[ -f "${DAEMON}" -a -x "${DAEMON}" ] || exit 0 + +# Read configuration variable file if it is present +[ -r "/etc/default/${NAME}" ] && . "/etc/default/${NAME}" + +ARGS="-f" +[ -z "${TVH_USER}" ] || ARGS="${ARGS} -u ${TVH_USER}" +[ -z "${TVH_GROUP}" ] || ARGS="${ARGS} -g ${TVH_GROUP}" +[ -z "${TVH_ADAPTERS}" ] || ARGS="${ARGS} -a ${TVH_ADAPTERS}" +[ -z "${TVH_HTTP_PORT}" ] || ARGS="${ARGS} -w ${TVH_HTTP_PORT}" +[ -z "${TVH_HTSP_PORT}" ] || ARGS="${ARGS} -e ${TVH_HTSP_PORT}" +[ "${TVH_DEBUG}" = "1" ] && ARGS="${ARGS} -s" + +case "$1" in + start) + printf "Starting TVHeadend daemon: " + if start-stop-daemon -S -q -p ${PIDFILE} -m --exec "${DAEMON}" -- ${ARGS}; then + printf "OK\n" + else + printf "failed\n" + fi + ;; + stop) + printf "Stopping TVHeadend daemon: " + start-stop-daemon -K -q -p ${PIDFILE} -s TERM + sleep 2 + if start-stop-daemon -K -q -p ${PIDFILE} -t; then + printf "failed, killing: " + start-stop-daemon -K -q -p ${PIDFILE} -s KILL -o + fi + printf "OK\n" + ;; + restart|force-reload) + "${0}" stop + sleep 2 + "${0}" start + ;; + *) + echo "Usage: $0 {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +: