Skip to content

Commit

Permalink
Using --startas instead of --exec now in order to make start scri…
Browse files Browse the repository at this point in the history
…pt idempotent. This will only use PID file to check whether application is started or not. `--exec` in contrast is also checks the `/proc/[PID]/exe` file which links to the java executable and not original start script (see [this article](https://chris-lamb.co.uk/posts/start-stop-daemon-exec-vs-startas)). For more detail please see the discussion on sbt#451
  • Loading branch information
OlegIlyenko committed Jan 7, 2015
1 parent 5fdf04c commit a2bc51f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ RUN_CMD="${{chdir}}/bin/${{exec}}"
start_daemon() {
log_daemon_msg "Starting" "${{app_name}}"
[ -d "/var/run/${{app_name}}" ] || install -d -o "$DAEMON_USER" -g "$DAEMON_GROUP" -m755 "/var/run/${{app_name}}"
start-stop-daemon --background --chdir ${{chdir}} --chuid "$DAEMON_USER" --make-pidfile --pidfile "$PIDFILE" --exec "$RUN_CMD" --start -- $RUN_OPTS
start-stop-daemon --background --chdir ${{chdir}} --chuid "$DAEMON_USER" --make-pidfile --pidfile "$PIDFILE" --startas "$RUN_CMD" --start -- $RUN_OPTS
log_end_msg $?
}

Expand Down

0 comments on commit a2bc51f

Please sign in to comment.