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

Fully Executable Jar doesn't start on Ubuntu 15.10 #5983

Closed
kpb opened this issue May 17, 2016 · 11 comments
Closed

Fully Executable Jar doesn't start on Ubuntu 15.10 #5983

kpb opened this issue May 17, 2016 · 11 comments
Labels
status: declined A suggestion or change that we don't feel we should currently apply

Comments

@kpb
Copy link

kpb commented May 17, 2016

Not sure this isn't my error...

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 15.10

$ spring --version
Spring CLI v1.3.5.RELEASE

$ spring init --build=gradle foo
  • modify build script to create fully executable jar
  • Build jar
$ ln -s /tmp/bar/build/libs/foo-0.0.1-SNAPSHOT.jar /etc/init.d/foo
$ service foo start
Failed to start foo.service: Unit foo.service failed to load: No such file or directory.

The service WILL start with /etc/init.d/foo start

Same jarfile and procedure works on Redhat and CentOS (using the service command).

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 17, 2016
@snicoll
Copy link
Member

snicoll commented May 18, 2016

Does influxdata/influxdb#3989 help? Looks like the exact same issue with a different service. Note that we do support systemctl

@snicoll snicoll added status: waiting-for-feedback We need additional information before we can continue and removed status: waiting-for-triage An issue we've not yet triaged labels May 18, 2016
@kpb
Copy link
Author

kpb commented May 18, 2016

It's the same issue. However, Ubuntu 15.10 does have lots of init.d scripts that do work with the service command.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels May 18, 2016
@kpb
Copy link
Author

kpb commented May 18, 2016

Update: Setting the DEBUG env var allowed me to see the error using systemctl satus foo. The jar needed perms (755).

Also, following the spring-boot ref docs for systemd:

$ systemctl start foo.service
$ systemctl status foo.service
● foo.service - foo
   Loaded: loaded (/etc/systemd/system/foo.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2016-05-18 09:32:13 MDT; 2s ago
  Process: 6755 ExecStart=/home/kbowen/foo-0.0.1-SNAPSHOT.jar (code=exited, status=203/EXEC)
 Main PID: 6755 (code=exited, status=203/EXEC)

May 18 09:32:13 dev systemd[1]: Started foo.
May 18 09:32:13 dev systemd[1]: Starting foo...
May 18 09:32:13 dev systemd[1]: foo.service: main process exited, code=exited, status=203/EXEC
May 18 09:32:13 dev systemd[1]: Unit foo.service entered failed state.
May 18 09:32:13 dev systemd[1]: foo.service failed.

@kpb
Copy link
Author

kpb commented May 18, 2016

Oddly, there's some sys V -- systemd compatabiltiy issue on Ubuntu 15.04. The jar works fine on redhat 7.2, without a .service file. Does not work on Ubuntu 15.04.

Not sure the systemd debacle is spring-boot's problem, although this feature (executable jar) makes our CI much easier.

@selimok
Copy link

selimok commented Oct 13, 2016

Unfortunately I have same problem with Ubuntu 16.04. I tried both SystemV and systemd methods described in the documentation here: http://docs.spring.io/spring-boot/docs/1.3.0.BUILD-SNAPSHOT/reference/htmlsingle/#deployment-service

If I tried to start service I got following error:

selimok@Ubuntu-1604-xenial-64-minimal:/etc/init.d$ service myapp start
Failed to start myapp.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files
See system logs and 'systemctl status myapp.service' for details.

And i got following details about the execution:

selimok@Ubuntu-1604-xenial-64-minimal:/etc/init.d$ sudo systemctl status myapp.service
● myapp.service - myapp
   Loaded: loaded (/etc/systemd/system/myapp.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2016-10-14 00:09:53 CEST; 20s ago
  Process: 28938 ExecStart=/opt/deploy/myapp/application.jar (code=exited, status=1/FAILURE)
 Main PID: 28938 (code=exited, status=1/FAILURE)

Oct 14 00:09:53 Ubuntu-1604-xenial-64-minimal systemd[1]: Started myapp.
Oct 14 00:09:53 Ubuntu-1604-xenial-64-minimal systemd[1]: myapp.service: Main process exited, code=exited, status=1/FAILURE
Oct 14 00:09:53 Ubuntu-1604-xenial-64-minimal systemd[1]: myapp.service: Unit entered failed state.
Oct 14 00:09:53 Ubuntu-1604-xenial-64-minimal systemd[1]: myapp.service: Failed with result 'exit-code'.

Same JAR file works perfectly as a SystemV service on a CentOS release 6.7 machine.

FYI.

@wilkinsona
Copy link
Member

@selimok Thanks for the information. We have integration tests that verify the launch script works with System V. Those tests run successfully on Ubuntu Xenial. The error message suggests a permissions problem. See http://unix.stackexchange.com/questions/158494/the-name-org-freedesktop-policykit1-was-not-provided-by-any-service-files, for example.

@GlassBeaver
Copy link

I had the same problem, and chmod +x myfile.jar fixed it. Running Centos 7.

@wilkinsona
Copy link
Member

Unless I've missed something, I think this was just a permissions problem. Please correct me if I'm mistaken.

@wilkinsona wilkinsona added status: declined A suggestion or change that we don't feel we should currently apply and removed status: feedback-provided Feedback has been provided labels Feb 7, 2017
@recodyx
Copy link

recodyx commented Sep 19, 2018

Still not working for me Ubuntu 18.04.

Why closed?

@wilkinsona
Copy link
Member

Why closed?

Because, as mentioned in the comment immediately above yours, it was a permissions problem. If you think that's not the problem in your case, please open a new issue with a minimal sample and precise instructions of how to reproduce the problem.

@kpb
Copy link
Author

kpb commented Sep 20, 2018

There was both a perms issue and an Ubuntu 15.04 systemd issue.

On updated systems, we are running 40+ spring boot services using systemd. (All praise systemd).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined A suggestion or change that we don't feel we should currently apply
Projects
None yet
Development

No branches or pull requests

7 participants