We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 82b62ea commit 93a9b81Copy full SHA for 93a9b81
.ebextensions/00-makeFiles.config
@@ -7,9 +7,15 @@ files:
7
#!/usr/bin/env bash
8
JAR_PATH=/var/app/current/application.jar
9
10
+ # kill existing java process if running
11
if pgrep java > /dev/null; then
12
killall java
13
sleep 5
14
fi
15
- java -Dfile.encoding=UTF-8 -Dspring.profiles.active=prod -jar $JAR_PATH > /var/log/web.log 2>&1 &
16
+ # ensure directory exists
17
+ mkdir -p /var/pids
18
+
19
+ # start application and save pid
20
+ nohup java -Dfile.encoding=UTF-8 -Dspring.profiles.active=prod -jar $JAR_PATH > /var/log/web.log 2>&1 &
21
+ echo $! > /var/pids/web.pid
0 commit comments