只是无法在 Ubuntu 中自动启动 tomcat。怎么了?

发布于 2024-08-17 05:10:50 字数 842 浏览 5 评论 0原文

我尝试了两种方法:

  1. 在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

  2. 运行:

    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:

  1. 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.sh

  2. Run 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

初心 2024-08-24 05:10:50

最有可能的是,startup.sh 没有设置可执行位。

chmod +x startup.sh

我至少在几个捆绑 Tomcat 的软件包中看到过这个问题。

Most likely, startup.sh doesn't have executable bit set.

chmod +x startup.sh

I have seen this issue with at least couple of software packages which bundle Tomcat.

素染倾城色 2024-08-24 05:10:50

运行级别是在启动序列中的不同点启动不同的事物。
您还可以将它们用作部分重启。

传统上它们是:

  1. 单用户模式
  2. ​​仅多用户模式控制台登录(无需网络)
  3. 多用户模式,控制台登录
  4. 未使用
  5. 多用户模式,带显示
  6. 重新启动

且 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:

  1. Single-User mode
  2. Multi-user mode console logins only (without networking)
  3. Multi-User mode, console logins
  4. Not used
  5. Multi-User mode, with display
  6. Reboot

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'

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文