Auto run Jetty on boot

2019-04-08 07:00发布

问题:

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.



标签: Jetty