Giter Site home page Giter Site logo

spring-boot-initscript's Introduction

Spring Boot init.d script

NOTE: As of Spring Boot 1.3 it is possible to have an official init.d script injected onto the front of a packaged .jar file. Instructions found in the Spring documentation

This script is meant to run a spring-boot project as a linux service using initd. It is meant as a template that can be reconfigured to an arbitrary war file.

Use the variable names at the top of the script to customize to your specific project.

This file is known to work with CentOS, however, will not work yet for Ubuntu (due to the differences in /etc/init.d/functions).

Parameter Description Default Value
PROJECT_NAME the name of the project, will also be used for the war file, log file, ... springboot
SERVICE_USER the user which should run the service root
SPRINGBOOTAPP_HOME base directory for the spring boot jar /usr/local/$PROJECT_NAME
SPRINGBOOTAPP_WAR the jar/war file to start via java -jar $SPRINGBOOTAPP_HOME/$PROJECT_NAME.war
SPRINGBOOTAPP_JAVA java executable for spring boot app, change if you have multiple jdks installed $JAVA_HOME/bin/java

spring-boot-initscript's People

Contributors

benashby avatar bryant1410 avatar rburgst avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spring-boot-initscript's Issues

Problem when run the script

Hi,

I'm having an issue with the script, seems that is not taking the JAVA_HOME variable. However, in the console when I do "java -version" I get the correct version; also I try to run in console this $JAVA_HOME/bin/java -jar myapp.jar and I can see where the application start, for some reason when I try to run using the script I get the following error in the log

nohup: failed to run command ‘/bin/java’: No such file or directory

initscript broken in current 1.3.0.SNAPSHOT

This was working perfectly but recently broke in the
I tried some of the older SNAPSHOT builds from here:
http://repo.spring.io/libs-snapshot-local/org/springframework/boot/spring-boot/1.3.0.BUILD-SNAPSHOT/spring-boot-1.3.0.BUILD-20150609.143456-213.jar
but all the currently available SNAPSHOTS are broken too.
From 1.3.0.BUILD-20150605.174051-204 to 1.3.0.BUILD-20150609.143456-213 have this problem.

Now when I try start a service, I get the same thing I got before I realized that this was a 1.3.0 feature only:

/etc/init.d/nim-cmas start
zsh: exec format error: /etc/init.d/nim-cmas

When I do start seems to be in a loop and never return to the console

Hi,

I was doing some testing of the script in amazon aws linux, I place the file in init.d and change all the variables seems to be working but not with the start command.

When I call start I can see in the console where the app is starting but and it shows "Starting boot-log4j2: " but never returns, seems to be in a loop.

Env: Amazon AWS linux, java 8

Do you know how to fix this issue?

Very Helpful

Thanks for this template it was very helpful. One thing I have noticed with this script is that when I start my service: "sudo service my-spring-boot start" is that the cursor is not released so I have to hit CTRL-C. This is on Amazon's Linux (RHEL), any ideas?

Also for some reason the script has a hard time resolving the $JAVA_HOME, even root and the current user has it set (probably an environment issue). I just worked around this one by modifying the script.

License?

Is this script intended to be shared with others? If so, you sould probably add a license to the repo.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.