Skip to content

Commit

Permalink
Merge pull request #300 from mrwulf/FixInit
Browse files Browse the repository at this point in the history
Fixing init service start/stop messages and locks
  • Loading branch information
solarkennedy committed Dec 10, 2016
2 parents 391825a + c90154c commit 54dc3be
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions templates/consul.init.erb
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ start() {
[ -f $PID_FILE ] && rm $PID_FILE
daemon --user=<%= scope.lookupvar('consul::user') %> \
--pidfile="$PID_FILE" \
"$CONSUL" agent -pid-file "${PID_FILE}" -config-dir "$CONFIG" <%= scope.lookupvar('consul::extra_options') %> >> "$LOG_FILE" &
$("$CONSUL" agent -pid-file "${PID_FILE}" -config-dir "$CONFIG" <%= scope.lookupvar('consul::extra_options') %> >> "$LOG_FILE" &)
retcode=$?
touch /var/lock/subsys/consul
echo
[ $retcode = 0 ] && touch /var/lock/subsys/consul
return $retcode
}

Expand Down Expand Up @@ -95,8 +96,8 @@ stop() {
# killproc with no arguments uses TERM, then escalates to KILL.
killproc $KILLPROC_OPT $CONSUL
retcode=$?

rm -f /var/lock/subsys/consul $PID_FILE
echo
[ $retcode = 0 ] && rm -f /var/lock/subsys/consul $PID_FILE
return $retcode
}

Expand Down

0 comments on commit 54dc3be

Please sign in to comment.