Start a java application and write its PID to file using nohup
#!/usr/bin/env bash
nohup java -jar target/my-awesome-app-0.0.1-SNAPSHOT.jar > /dev/null 2>&1 & echo $! > /usr/local/var/run/my-awesome-app.pid
Written by Deepu Mohan Puthrote
Related protips
1 Response
👍👍
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Pid
Authors
warfox
4.015K
paulspringett
3.34K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#