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

Very Helpful #1

Open
kibbled opened this issue Feb 2, 2015 · 6 comments
Open

Very Helpful #1

kibbled opened this issue Feb 2, 2015 · 6 comments

Comments

@kibbled
Copy link

kibbled commented Feb 2, 2015

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.

@rburgst
Copy link
Owner

rburgst commented Feb 3, 2015

I don't see why the cursor would be captured. Try and put a few echos into the script to see how far its coming and whether it stops somewhere.

@mherb63
Copy link

mherb63 commented Feb 18, 2015

I have the same issue as kibbled, its stuck in this loop on "start"

while { pid_of_spring_boot > /dev/null ; } &&
! { tail --lines=+$cnt "$LOG" | grep -q ' Started \S+ in' ; } ; do
sleep 1
done

@rburgst
Copy link
Owner

rburgst commented Feb 19, 2015

please check what the output of your server is when it boots up. The goal here is to find a line that says something like "Started XXX in Ys". Aparently your log levels are different which prevents this message from showing up. You might need to adapt your log levels or grep for some other log line to figure out whether the server has finished booting.

@mherb63
Copy link

mherb63 commented Feb 19, 2015

Sorry, I'm not much of a bash scripter. But, here's the line I think you're grepping for:

2015-02-19 13:18:29.692 INFO 4044 --- [main] com.xxx.yyy.Application : Started Application in 18.421 seconds (JVM running for 19.248)

I am using Spring Boot default logging, in my application.properties file I'm setting:
logging.file:logs/myapp.log

@rburgst
Copy link
Owner

rburgst commented Feb 19, 2015

the script expects the log file to go to

 LOG="/var/log/$PROJECT_NAME/$PROJECT_NAME.log"

If you configure the app to some other log file, then you need to change this value.
If that alone is not enough you can relax the REGEXP to do

grep -q ' Started Application in .* seconds' 

@mherb63
Copy link

mherb63 commented Feb 19, 2015

Changing the grep -q fixed this issue. Thanks!

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

3 participants