用jsvc运行tomcat6 [英] running tomcat6 with jsvc

查看:331
本文介绍了用jsvc运行tomcat6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用jsvc运行tomcat6,以便在启动时获得用户权限.

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

我正在尝试使用tomcat文档中的代码运行: http://tomcat.apache.org/tomcat-6.0-doc/setup.html

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

这些是我得到的错误:

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

还必须提及的是,我没有按照指南中指定的来源安装tomcat和jsvc.相反,我是使用synaptic从软件包中安装它们的.

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.

更新:

我现在以脚本形式运行它,这是代码:

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

我还尝试从突触中删除我所做的jsvc安装,并从源代码安装jsvc 1.0.10版.它没有帮助.

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.

推荐答案

除了bootstrap.jar之外,您还需要在类路径中添加bin/commons-daemon.jar

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

这篇关于用jsvc运行tomcat6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆