只是无法在 Ubuntu 中自动启动 tomcat。怎么了?
我尝试了两种方法:
在etc/rc.local中添加以下内容:
导出JAVA_HOME=/home/phonies/jdk1.6.0_17
导出 JRE_HOME=/home/phonies/jdk1.6.0_17/jre
导出 CLASSPATH=.:/home/phenies/jdk1.6.0_17/lib/*
/home/phoenies/scarab-0.21/tomcat/bin/startup.sh运行:
ln -s -t /etc/init.d /home/phenies/scarab-0.21/tomcat/bin/startup.sh
mv /etc/init.d/startup.sh /etc/init.d/tomcat
update-rc.d tomcat 默认值 99
都不起作用。我已确保所有脚本都有运行权限。我已经用 sysv-rc-conf 检查过 rc.local 和 tomcat 将在运行级别 2-5 中运行。我可以通过双击其中任何一个来手动启动 tomcat。有人知道为什么tomcat仍然不自启动吗?
我的操作系统是 Ubuntu 9.04,Tomcat 4.1 包含在 Scarab 0.21 中,如您所见。
编辑:我刚刚检查了sysv-rc-conf
中的所有运行级别,这次成功了!我不熟悉运行级别这个概念。有人可以解释一下我的操作系统正在运行什么运行级别吗?其他运行级别有什么用?谢谢。
重新编辑: runlevel
告诉我当前的运行级别是 2。我不明白...:(
I tried two ways:
Add the following in etc/rc.local:
export JAVA_HOME=/home/phoenies/jdk1.6.0_17
export JRE_HOME=/home/phoenies/jdk1.6.0_17/jre
export CLASSPATH=.:/home/phoenies/jdk1.6.0_17/lib/*
/home/phoenies/scarab-0.21/tomcat/bin/startup.shRun this:
ln -s -t /etc/init.d /home/phoenies/scarab-0.21/tomcat/bin/startup.sh
mv /etc/init.d/startup.sh /etc/init.d/tomcat
update-rc.d tomcat defaults 99
Neither worked. I've made sure all scripts have the permission to run. I've checked with sysv-rc-conf
that rc.local and tomcat would run in runlevels 2-5. And I can startup tomcat manually by double-clicking either of them. Anyone knows why tomcat still doesn't autostart?
My OS is Ubuntu 9.04, Tomcat 4.1 is included in Scarab 0.21 as you can see.
Edit: I've just checked all runlevels in sysv-rc-conf
, and this time it worked! I'm not familiar with the concept runlevel. Would someone kindly explain what runlevel my OS is running on? And what are other runlevels for? Thanks.
Reedit: runlevel
told me the current runlevel is 2. I don't understand... :(
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最有可能的是,
startup.sh
没有设置可执行位。我至少在几个捆绑 Tomcat 的软件包中看到过这个问题。
Most likely,
startup.sh
doesn't have executable bit set.I have seen this issue with at least couple of software packages which bundle Tomcat.
运行级别是在启动序列中的不同点启动不同的事物。
您还可以将它们用作部分重启。
传统上它们是:
且 0 = 停止(但 SO 的列表不会执行 0,因为 Jeff 不这样做)不知道“C”)
对于基于 ubuntu/debian 的 Linux,它们使用得不多,系统总是运行在 2 中。
启动由一个名为“startup”的程序处理
Runlevels are to start different things at different points in the start sequence.
You can also use them as a sort of partial reboot.
Tradiationally they are:
and 0 = halt (but SO's list wont do 0 because Jeff doesn't know 'C' )
For ubuntu/debian based Linux they aren't used as much, the system always runs in 2.
the startup is handled by a program called 'startup'