From: ingvar Date: Thu, 17 May 2007 18:17:12 +0000 (+0000) Subject: just some output cleanup X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f56bc7793777cff345551fa7a9dd362e73f29da3;p=varnish just some output cleanup git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1447 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/redhat/varnish.initrc b/varnish-cache/redhat/varnish.initrc index 106bbd52..a7744d9f 100755 --- a/varnish-cache/redhat/varnish.initrc +++ b/varnish-cache/redhat/varnish.initrc @@ -21,14 +21,6 @@ LOCKFILE=/var/lock/subsys/varnish DAEMON="/usr/sbin/varnishd" -# $DAEMON_OPTS is set in /etc/sysconfig/varnish. At least, one -# have to set up a backend. -if [ "$DAEMON_OPTS" = "" ]; then - echo "No values specified in DAEMON_OPTS. Please read the varnishd(1)" - echo "manpage and put configuration options in /etc/sysconfig/varnish" - exit 1 -fi - mkdir -p /var/run/varnish 2>/dev/null # Open files (usually 1024, which is way too small for varnish) @@ -39,16 +31,25 @@ ulimit -n ${NFILES} case "$1" in start) echo -n "Starting varnish HTTP accelerator: " - daemon --pidfile ${PIDFILE} ${DAEMON} "$DAEMON_OPTS" -P ${PIDFILE} - sleep 1 - pkill -0 $PROCNAME - RETVAL=$? - if [ $RETVAL -eq 0 ] - then + + # $DAEMON_OPTS is set in /etc/sysconfig/varnish. At least, one + # has to set up a backend, or /tmp will be used, which is a bad idea. + if [ "$DAEMON_OPTS" = "" ]; then + echo "\$DAEMON_OPTS empty." + echo -n "Please put configuration options in /etc/sysconfig/varnish" + echo_failure + else + daemon --pidfile ${PIDFILE} ${DAEMON} "$DAEMON_OPTS" -P ${PIDFILE} > /dev/null 2>&1 + sleep 1 + pkill -0 $PROCNAME + RETVAL=$? + if [ $RETVAL -eq 0 ] + then echo_success touch $LOCKFILE - else + else echo_failure + fi fi echo ;;