]> err.no Git - varnish/commitdiff
just some output cleanup
authoringvar <ingvar@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 17 May 2007 18:17:12 +0000 (18:17 +0000)
committeringvar <ingvar@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 17 May 2007 18:17:12 +0000 (18:17 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1447 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/redhat/varnish.initrc

index 106bbd52a2fd43d32f30e3345429121df3d0847c..a7744d9fde47304dcd038e99df0ab2ceb67925c9 100755 (executable)
@@ -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
        ;;