Improve portability by using type instead of which in the launch script

Previously, the launch script used which to determine the availability
of start-stop-daemon. which isn’t available by default on all OSs.
For example, it’s not available by default on CentOS 5.

This commit updates the launch script to use type when determining if
start-stop-daemon is available. This improves the portability of the
script and makes the use of type consistent throughout the script.

Closes gh-4925
This commit is contained in:
Andy Wilkinson 2016-01-11 17:53:51 +00:00
parent a1e0f2f5f0
commit 04fe55a2ab
1 changed files with 1 additions and 1 deletions

View File

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