Allow easy opt-out of using start-stop-daemon

Allow users to easily opt-opt of using the start-stop-daemon in the
launch script. This may be required on distros that include older
versions.

Fixes gh-4732
This commit is contained in:
Phillip Webb 2015-12-15 20:35:47 +00:00
parent 8c15905040
commit 5a1ee6ebe8
2 changed files with 8 additions and 3 deletions

View File

@ -548,9 +548,14 @@ Gradle and to `${project.description}` (falling back to `${project.name}`) for M
|`initInfoChkconfig` |`initInfoChkconfig`
|The `chkconfig` section of "`INIT INFO`". Defaults to `2345 99 01`. |The `chkconfig` section of "`INIT INFO`". Defaults to `2345 99 01`.
|`useStartStopDaemon`
|If the start-stop command should be used to control the process when it's available.
Defaults to `true`.
|=== |===
[[deployment-script-customization-conf-file]] [[deployment-script-customization-conf-file]]
==== Customizing the startup script with a conf file ==== Customizing the startup script with a conf file

View File

@ -143,7 +143,7 @@ do_start() {
chown "$run_user" "$PID_FOLDER" chown "$run_user" "$PID_FOLDER"
chown "$run_user" "$pid_file" chown "$run_user" "$pid_file"
chown "$run_user" "$log_file" chown "$run_user" "$log_file"
if which start-stop-daemon >/dev/null; then if [ {{useStartStopDaemon:true}} = true ] && which start-stop-daemon >/dev/null; then
start-stop-daemon --start --quiet \ start-stop-daemon --start --quiet \
--chuid $run_user \ --chuid $run_user \
--name $identity \ --name $identity \