g9ejca
Last Updated: July 05, 2019
·
1.19K
· 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

34374

👍👍

11 days ago ·