title: running tomcat6 with jsvc
body: <p>I'm trying to run tomcat6 with jsvc in order to get user privileges at start.</p>
  
  <p>I'm trying to run using the code in the tomcat documentation: <a href="http://tomcat.apache.org/tomcat-6.0-doc/setup.html" rel="nofollow">http://tomcat.apache.org/tomcat-6.0-doc/setup.html</a></p>
  
  <pre><code>cd $CATALINA_HOME
  ./bin/jsvc -cp ./bin/bootstrap.jar \
      -outfile ./logs/catalina.out -errfile ./logs/catalina.err \
      org.apache.catalina.startup.Bootstrap
  </code></pre>
  
  <p>And these are the errors I get:</p>
  
  <pre><code>Unable to redirect to ./logs/catalina.out
  Unable to redirect to ./logs/catalina.err
  Cannot open PID file /var/run/jsvc.pid, PID is 2813
  Service exit with a return value of 255
  </code></pre>
  
  <p>It is also important to mention that I did not installed tomcat and jsvc from sources as specified in the guide. Instead I installed them from package using synaptic.</p>
  
  <hr>
  
  <p>UPDATE:</p>
  
  <p>I'm running it as script now, here is the code:</p>
  
  <pre><code>#!/bin/sh
  
  export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk
  export CATALINA_HOME=/usr/share/tomcat6
  ./bin/jsvc -cp ./bin/bootstrap.jar:$JAVA_HOME\
      -outfile ./logs/catalina.out -errfile ./logs/catalina.err \
      org.apache.catalina.startup.Bootstrap
  </code></pre>
  
  <p>now I'm getting a different error:</p>
  
  <pre><code>Cannot find daemon loader org/apache/commons/daemon/support/DaemonLoader
  Service exit with a return value of 1
  </code></pre>
  
  <p>I also tried to remove the jsvc installation I did from synaptic and install version 1.0.10 of jsvc from sources. It did not help.</p>