Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service does not start on Ubuntu 14.04 #2

Open
jopasserat opened this issue Jan 10, 2015 · 6 comments
Open

Service does not start on Ubuntu 14.04 #2

jopasserat opened this issue Jan 10, 2015 · 6 comments

Comments

@jopasserat
Copy link

It seems that commit 053f259 introduces a regression that prevents the service to start on a fresh Ubuntu 14.04.

@gsick
Copy link
Owner

gsick commented Jan 11, 2015

This commit has nothing to do, the default init script from jetty dist doesn't respect the linux spec. it should exit with 0 for start cmd when the process is already running.
I tried and tested on docker/ubuntu 14 and it works.

What is the error on your side?

@jopasserat
Copy link
Author

This is what it returns in my case:

Error: Could not start Service[jetty]: Execution of '/etc/init.d/jetty start' returned 1: 
Error: /Stage[main]/Jetty/Service[jetty]/ensure: change from stopped to running failed: Could not    start Service[jetty]: Execution of '/etc/init.d/jetty start' returned 1:

and the service if launched manually (service jetty start) from the VM gives:

root@testCloud1:/etc/puppet/modules/jetty# service jetty restart
  Stopping Jetty: start-stop-daemon: warning: failed to kill 9559: No such process
  1 pids were not killed
  No process in pidfile '/var/run/jetty.pid' found running; none killed.
  OK
  Starting Jetty: FAILED Sat Jan 10 21:18:16 GMT 2015

on the other hand, using the command line that the service is supposed to run, launches is fine (regardless of the current directory, here /tmp)

root@testCloud1:/tmp# su jetty -c "/usr/bin/java -Djetty.home=/opt/jetty -Djetty.base=/opt/jetty -Djava.io.tmpdir=/tmp -jar /opt/jetty/start.jar jetty-started.xml &"
  root@testCloud1:/tmp# 2015-01-09 17:45:56.868:INFO::main: Logging initialized @397ms
  2015-01-09 17:45:57.167:INFO:oejs.Server:main: jetty-9.1.3.v20140225
  2015-01-09 17:45:57.201:INFO:oejdp.ScanningAppProvider:main: Deployment monitor [file:/opt/jetty-distribution-9.1.3.v20140225/webapps/] at interval 1
  2015-01-09 17:45:57.222:INFO:oejs.ServerConnector:main: Started   ServerConnector@6b2d2436{HTTP/1.1}{0.0.0.0:8080}
  2015-01-09 17:45:57.223:INFO:oejs.Server:main: Started @756ms

My fork that reverts the commit I mention provisions the machine fine and the service starts.

@gsick
Copy link
Owner

gsick commented Jan 12, 2015

I have no clue.

I tried on ec2 - ubuntu 14.04. Everything looks fine

ubuntu@ip-xxxxx:/etc/puppet$ puppet --version
3.4.3
ubuntu@ip-xxxxx:/etc/puppet$ sudo puppet apply manifests/init.pp
Notice: Compiled catalog for ip-xxxxx.ec2.internal in environment production in 1.14 seconds
Notice: /Stage[main]/Java/Package[java]/ensure: ensure changed 'purged' to 'present'
Notice: /Stage[main]/Jetty/Exec[download jetty]/returns: executed successfully
Notice: /Stage[main]/Jetty/File[jetty default]/ensure: created
........
Notice: /Stage[main]/Jetty/File[jetty home]/ensure: created
Notice: /Stage[main]/Jetty/File[jetty demo]/ensure: removed
Notice: /Stage[main]/Jetty/File[jetty init]/ensure: defined content as '{md5}71da8450d25685e584aaa02d5779792e'
Notice: /Stage[main]/Jetty/Service[jetty]/ensure: ensure changed 'stopped' to 'running'
Notice: Finished catalog run in 107.79 seconds

ubuntu@ip-xxxxx:/etc/puppet$ sudo service jetty status
Checking arguments to Jetty:
START_INI = /opt/jetty/start.ini
JETTY_HOME = /opt/jetty
JETTY_BASE = /opt/jetty
JETTY_CONF = /opt/jetty/etc/jetty.conf
JETTY_PID = /var/run/jetty.pid
JETTY_START = /opt/jetty/start.jar
JETTY_LOGS = /var/log/jetty
JETTY_STATE = /opt/jetty/jetty.state
CLASSPATH =
JAVA = /usr/bin/java
JAVA_OPTIONS = -Djetty.home=/opt/jetty -Djetty.base=/opt/jetty -Djava.io.tmpdir=/tmp
JETTY_ARGS = jetty-started.xml
RUN_CMD = /usr/bin/java -Djetty.home=/opt/jetty -Djetty.base=/opt/jetty -Djava.io.tmpdir=/tmp -jar /opt/jetty/start.jar jetty-started.xml

Jetty running pid=13399
ubuntu@ip-xxxxx:/etc/puppet$ sudo service jetty restart
Stopping Jetty: OK
Starting Jetty: OK Mon Jan 12 17:16:27 UTC 2015

Did you try on a fresh server? Are you sure you don't have a jetty already running?

@jopasserat
Copy link
Author

Yeah I've just destroyed and recreated my VM. It might be because I'm using a slightly modified Ubuntu customized by my ops team. But as far as I know they only perform modifications related to security, nothing that should impact jetty.

But I guess it should not be considered an issue if it works for a standard Ubuntu.

@gsick
Copy link
Owner

gsick commented Jan 13, 2015

Have you some error on /var/log/messages?

@jopasserat
Copy link
Author

This file is not present on my system

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants