title: Syntax error near unexpected token when running spring boot jar as service
body: <p>I want to run my Spring boot based application as a service using init.d (Server is a Redhat 5.9).</p>
  
  <p>When running <code>service myapp start</code> or <code>/etc/init.d/myapp start</code>, I get the following error:</p>
  
  <pre><code>/etc/init.d/myapp: line 168: syntax error near unexpected token `&gt;'
  /etc/init.d/myapp: line 168: `    $command &amp;&gt;&gt; "$log_file" &amp;
  </code></pre>
  
  <p>I ran <code>sh -x /etc/init.d/myapp status</code> to see what is happening, but it did not help me much. This is the last part of the output:</p>
  
  <pre><code>+ PID_FOLDER=/var/run/myapp
  + pid_file=/var/run/myapp/myapp.pid
  + log_file=/app/myapp//myapp.log
  ++ id -u
  + [[ 0 == \0 ]]
  ++ awk '{print $3}'
  ++ ls -ld /app/myapp/myapp-server-0.0.1-SNAPSHOT.jar
  + run_user=myapp
  + [[ -n /usr/java/default ]]
  + [[ -x /usr/java/default/bin/java ]]
  + javaexe=/usr/java/default/bin/java
  + command='/usr/java/default/bin/java -Dsun.misc.URLClassPath.disableJarChecking=true  -jar /app/myapp/myapp-server-0.0.1-SNAPSHOT.jar  '
  /etc/init.d/myapp: line 168: syntax error near unexpected token `&gt;'
  /etc/init.d/myapp: line 168: `    $command &amp;&gt;&gt; "$log_file" &amp;'
  </code></pre>
  
  <p>I do have a <code>.conf</code> file next to my jar as well:</p>
  
  <pre><code>[root@appdev02 myapp]# cat myapp-server-0.0.1-SNAPSHOT.conf
  MODE=service
  LOG_FOLDER=/app/myapp/
  JAVA_HOME=/usr/java/default
  </code></pre>
  
  <p>I am using Spring Boot 1.3.1</p>
  
  <p>UPDATE:
  I downgraded to Spring Boot 1.3.0 and things started working:</p>
  
  <pre><code>[root@appdev02 ~]# service myapp start
  which: no start-stop-daemon in (/sbin:/usr/sbin:/bin:/usr/bin)
  Started [19564]
  </code></pre>