anchor.diff:              exit 0
           fi
           ;;
  -    restart)
  -        if [ -f "$LOG_PID" ]; then
  -            cd $HOME_DIR
  -            `$CMD -stop $MAIN`
  -            `$CMD $MAIN`
  -        else 
  -            echo "Service not running? File $LOG_PID not found."
  -            exit 1
  -        fi
  -        ;;
       *)
  -        echo "usage: daemon {start|stop|status|restart}" >&2
  +        echo "usage: daemon {start|stop|status}" >&2
           exit 1
           ;;
   esac
positive.code: #!/bin/sh
  
  # Setup basic path information.
  EXEC=/usr/bin/jsvc 
  MAIN=com.webtrends.streaming.CollectionDaemon
  USER="<%= @user %>"
  LOG_PID="<%=File.join(@log_dir,"streamingcollection.pid")%>"
  LOG_OUT="<%=File.join(@log_dir,"streamingcollection.out")%>"
  LOG_ERR="<%=File.join(@log_dir,"streamingcollection.err")%>"
  HOME_DIR="<%=@install_dir%>"
  
  # Setup classpath, initially empty.
  CP=""
  
negative.code: done
  
  # Create the JSVC command line.
  CMD="$JAVA_HOME/bin/java -cp $CP -Dcom.webtrends.log.dir=<%=@log_dir%> $JMX_OPTS"
  
  # Find current PID if any.
  FOUND_PID=`ps -ef |grep $MAIN |grep -v grep |awk {print $2}'`
  
  # Check what the caller wants.
  case "$1" in
      start)
          if [ "" = "$FOUND_PID" ]; then
              cd   $HOME_DIR
              echo $CMD $MAIN
              exec $CMD $MAIN >$LOG_OUT 2>$LOG_ERR &
          else 
              echo "Service already running!"
              exit 1
          fi
          ;;
      stop)
          if [ "" = "$FOUND_PID" ]; then
              echo "Service not running? File $LOG_PID not exist."
              exit 1
          else
              kill $FOUND_PID
              sleep 2
              FOUND_PID=`ps -ef |grep $MAIN |grep -v grep |awk {print $2}'`
              if [ "" != "$FOUND_PID" ]; then
                  echo "Sending kill -9 to process."
                  kill -9 $FOUND_PID
              fi
          fi 
          ;;
      status)
          # Status is found via actual running processes, rather than
          # trusting the PID log file.
          if [ "" = "$FOUND_PID" ]; then
              echo "Not running"
              exit 1
          else
  