Auto run Jetty on boot

非 Y 不嫁゛ 提交于 2019-12-21 13:08:39

问题


I'm trying to get Jetty to auto start on my Ubuntu. I've done these commands:

 cp /opt/jetty/bin/jetty.sh /etc/init.d
 update-rc.d jetty.sh defaults

but when I run it I got a "Not starting jetty - NO_START=1 ".

Does anyone know why?

Secondly, the following is stated inside the jetty.sh.

# To get the service to restart correctly on reboot, uncomment below (3 lines):
# ========================
# chkconfig: 3 99 99
# description: Jetty 7 webserver
# processname: jetty
# ========================

What "3 lines" are they referring to? I uncommented

chkconfig: 3 99 99
description: Jetty 7 webserver
processname: jetty

but got an error too.


回答1:


By default, Jetty doesn't startup by itself.

You have to modify /etc/default/jetty6 (or whereever your config file is) and set:

no_start = 0



回答2:


You can do this by commenting too. #NO_START=1

It can be easily done by following steps.

  1. In terminal type sudo vi /etc/default/jetty

  2. In the beginning you can see a line NO_START=1

  3. Press Insert key on your keyboard, then you can go to insert mode.

    In the bottom also you can see -INSERT- to make sure that you are in insert mode.

  4. Comment the line, #NO_START=1

  5. Press Esc to leave the escape mode.

  6. then type the following to save your changes and to exit. :wq!

Now you can start.



来源:https://stackoverflow.com/questions/7660314/auto-run-jetty-on-boot

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