running tomcat6 with jsvc

只愿长相守 提交于 2019-12-11 13:57:26

问题


I'm trying to run tomcat6 with jsvc in order to get user privileges at start.

I'm trying to run using the code in the tomcat documentation: http://tomcat.apache.org/tomcat-6.0-doc/setup.html

cd $CATALINA_HOME
./bin/jsvc -cp ./bin/bootstrap.jar \
    -outfile ./logs/catalina.out -errfile ./logs/catalina.err \
    org.apache.catalina.startup.Bootstrap

And these are the errors I get:

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

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.


UPDATE:

I'm running it as script now, here is the 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

now I'm getting a different error:

Cannot find daemon loader org/apache/commons/daemon/support/DaemonLoader
Service exit with a return value of 1

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.


回答1:


You need the bin/commons-daemon.jar in your classpath in addition to bootstrap.jar




回答2:


are you sure that CATELINA_HOME is properly exported ? or tomcat is started properly ?

may be that's the problem



来源:https://stackoverflow.com/questions/12887028/running-tomcat6-with-jsvc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!