anchor.diff:  <%- end -%>
   
   NAME=<%= @service_name %>
  -PID_FILE=/var/run/$NAME.pid
  +PID_FILE="/var/run/$NAME.pid"
   KAFKA_USER=kafka
   <%- case @service_name
     when 'kafka' -%>
  
positive.code:     status
  	;;
    start)
      echo "Starting daemon: "$NAME
      start
  	;;
    stop)
      echo "Stopping daemon: "$NAME
      stop
  	;;
    restart)
      echo "Restarting daemon: "$NAME
  	  stop
      sleep 2
      start
  
negative.code:     exit 1
    fi
  
    echo "$PID" > "$PID_FILE";
    echo "\n$NAME started"
  }
  
  stop() {
    if [ ! -f "$PID_FILE" ]; then
      echo "$PID_FILE does not exist, process is not running"
      return 1
    fi
  
    kill `cat "$PID_FILE"`;
    rm -f "$PID_FILE";
    echo "$NAME stopped"
    return 0
  }
  
  status() {
    if [ ! -f "$PID_FILE" ]; then
      echo "$NAME stopped"
      exit 1
    fi
  
    PID=`cat "$PID_FILE"`
    if `ps -p "$PID" -o pid= ` -eq `pgrep -f "$PGREP_PATTERN"`; then
      echo "$NAME stopped but pid file exists"
      exit 1
  