anchor.diff:  #!/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")%>"
  +LOG_OUT="<%=File.join(@log_dir,"streaming.out")%>"
  +LOG_ERR="<%=File.join(@log_dir,"streaming.err")%>"
   HOME_DIR="<%=@install_dir%>"
  +JAVA_HOME="<%=@java_home%>"
   
   # Setup classpath, initially empty.
   CP=""
  
positive.code: done
  
  # Create the JSVC command line.
  CMD="$EXEC -home <%=@java_home%> -cp $CP -user $USER -outfile $LOG_OUT -errfile $LOG_ERR -pidfile $LOG_PID -Dcom.webtrends.log.dir=<%=@log_dir%> $JMX_OPTS"
  
  # Check what the caller wants.
  case "$1" in
      start)
          if [ ! -f "$LOG_PID" ]; then
              cd $HOME_DIR
              echo $CMD $MAIN
              `$CMD $MAIN`
          else 
              echo "Service already running! File $LOG_PID exists!"
          fi
          ;;
      stop)
          if [ -f "$LOG_PID" ]; then
              cd $HOME_DIR
              `$CMD -stop $MAIN`
          else
              echo "Service not running? File $LOG_PID not exist."
          fi 
          ;;
      status)
          # Status is found via actual running processes, rather than
          # trusting the PID log file.
          FOUND=`ps -ef |grep $MAIN |grep -v grep`
          if [ "" = "$FOUND" ]; then
              echo "Not running"
              exit 1
          else
  
negative.code:             exit 0
          fi
          ;;
      *)
          echo "usage: daemon {start|stop|status}" >&2
          exit 1
          ;;
  esac