Last Updated: July 05, 2019
·
3.909K
· warfox

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

1 Response
Add your response

👍👍

over 1 year ago ·