Skip to content

Commit

Permalink
Merge pull request #115 from akerekes/redirect_stderr_to_syslog
Browse files Browse the repository at this point in the history
redirect stderr to syslog and do some cosmetical changes
  • Loading branch information
johnbellone committed Mar 14, 2015
2 parents 8e10248 + 77b2fd9 commit 5208d86
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions templates/default/consul-init.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
### BEGIN INIT INFO
# Provides: consul
# Required-Start: $network $remote_fs $syslog
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 5208d86

Please sign in to comment.