diff --git a/templates/default/consul-init.erb b/templates/default/consul-init.erb index 2bbe1ea0..f5510ea3 100644 --- a/templates/default/consul-init.erb +++ b/templates/default/consul-init.erb @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash ### BEGIN INIT INFO # Provides: consul # Required-Start: $network $remote_fs $syslog @@ -40,7 +40,8 @@ case "$1" in echo "$NAME already running" else echo "Starting $NAME" - $CMD >> "$LOGFILE" & + exec 2> >(while IFS= read -r line; do logger -t consul "$line"; done) + "${CMD[@]}" >> "$LOGFILE" & echo $! > "$PIDFILE" if ! is_running; then echo "Unable to start $NAME, see $LOGFILE"