diff options
author | 2008-07-06 15:53:59 +0000 | |
---|---|---|
committer | 2008-07-06 15:53:59 +0000 | |
commit | cdaa731792a9f14bdc7312beac19039c742aa7ce (patch) | |
tree | fcd5b4274339482b724aa6c6a1b356f213d8e2e2 /usr/share/vdr/rcscript | |
parent | Simplified waitfor function. Renamed DEVICE_CHECK to DVB_DEVICE_WAIT. Make ti... (diff) | |
download | gentoo-vdr-scripts-cdaa731792a9f14bdc7312beac19039c742aa7ce.tar.gz gentoo-vdr-scripts-cdaa731792a9f14bdc7312beac19039c742aa7ce.tar.bz2 gentoo-vdr-scripts-cdaa731792a9f14bdc7312beac19039c742aa7ce.zip |
Run post-start addons also when vdr did not start. This will print syslog output then. Add config-setting to disable syslog parsing.
svn path=/gentoo-vdr-scripts/trunk/; revision=630
Diffstat (limited to 'usr/share/vdr/rcscript')
-rw-r--r-- | usr/share/vdr/rcscript/post-start-50-svdrp.sh | 23 | ||||
-rw-r--r-- | usr/share/vdr/rcscript/post-start-60-check-syslog-errors.sh | 6 | ||||
-rw-r--r-- | usr/share/vdr/rcscript/pre-start-60-check-syslog-errors.sh | 24 |
3 files changed, 31 insertions, 22 deletions
diff --git a/usr/share/vdr/rcscript/post-start-50-svdrp.sh b/usr/share/vdr/rcscript/post-start-50-svdrp.sh index 2dff3e5..bf45349 100644 --- a/usr/share/vdr/rcscript/post-start-50-svdrp.sh +++ b/usr/share/vdr/rcscript/post-start-50-svdrp.sh @@ -1,6 +1,8 @@ # $Id$ addon_main() { - local ret=0 + # we already know vdr failed + [ "${vdr_start_failed}" = "1" ] && return 0 + SVDRP_PORT="${SVDRP_PORT:-2001}" SVDRP_HOSTNAME="${SVDRP_HOSTNAME:-localhost}" [ "${SVDRP_PORT}" = "0" ] && return 0 @@ -17,23 +19,26 @@ addon_main() { START_SVDRP_WAIT_SECONDS=${START_SVDRP_WAIT_SECONDS:-40} waitfor ${START_SVDRP_WAIT_SECONDS} svdrp_ready - ret=$? - case "$ret" in - 1) eend ${ret} "timeout, hoping that VDR is running good nevertheless" + case "$?" in + 0) eend 0 + ;; + 1) eend 1 "timeout. Hoping that VDR is running good nevertheless." einfo - einfo "Ignore this if you connected new remote/keyboard which gets learned." + einfo "Ignore this if you connected a new remote/keyboard which gets learned." einfo "If your computer is very slow it is possible that vdr" einfo "needs more than ${START_SVDRP_WAIT_SECONDS} seconds to be up and going." einfo "You can enlarge that value inside /etc/conf.d/vdr (START_SVDRP_WAIT_SECONDS)." einfo - ret=0 # continue with state "started" ;; - *) - eend ${ret} "aborted, please check logfile" + 2) eend 2 "VDR process died, please check logfile" + # tell init-script that vdr died + vdr_exitcode=1 + ;; esac - return $ret + + return 0 } svdrp_ready() { diff --git a/usr/share/vdr/rcscript/post-start-60-check-syslog-errors.sh b/usr/share/vdr/rcscript/post-start-60-check-syslog-errors.sh index a3df35a..536f520 100644 --- a/usr/share/vdr/rcscript/post-start-60-check-syslog-errors.sh +++ b/usr/share/vdr/rcscript/post-start-60-check-syslog-errors.sh @@ -29,11 +29,11 @@ addon_main() { | while read line; do count=$(($count+1)) if [ ${count} -eq 1 ]; then - eerror " Errors from ${SYSLOG_FILE}:" + eerror "VDR errors from ${SYSLOG_FILE}:" fi - eerror " $line" + eerror " $line" if [ "${count}" -gt 5 ]; then - eerror " More errors ..." + eerror "More errors ..." break fi done diff --git a/usr/share/vdr/rcscript/pre-start-60-check-syslog-errors.sh b/usr/share/vdr/rcscript/pre-start-60-check-syslog-errors.sh index e992ccd..7e31a83 100644 --- a/usr/share/vdr/rcscript/pre-start-60-check-syslog-errors.sh +++ b/usr/share/vdr/rcscript/pre-start-60-check-syslog-errors.sh @@ -1,21 +1,25 @@ addon_main() { - local FILES="/var/log/vdr.log /var/log/vdr/current /var/log/everything/current /var/log/messages" + yesno "${CHECK_SYSLOG_ERRORS:-yes}" || return 0 + + local s FILES="/var/log/vdr.log /var/log/vdr/current /var/log/everything/current /var/log/messages" SYSLOG_FILE="" - local s for s in ${FILES}; do if [ -f "${s}" ]; then SYSLOG_FILE="${s}" - - # Get size of file before vdr start - SYSLOG_SIZE_BEFORE="$(stat -c %s "${SYSLOG_FILE}")" - if [ -z "${SYSLOG_SIZE_BEFORE}" ]; then - # disable syslog-scanning - SYSLOG_FILE="" - fi - return 0 + break fi done + + # found a file? + [ -z "${SYSLOG_FILE}" ] && return 0 + + # Get size of file before vdr start + SYSLOG_SIZE_BEFORE="$(stat -c %s "${SYSLOG_FILE}")" + if [ -z "${SYSLOG_SIZE_BEFORE}" ]; then + # disable syslog-scanning + SYSLOG_FILE="" + fi return 0 } |