Skip to content

Commit

Permalink
Add support for writing logs to /var/log/consul.log.
Browse files Browse the repository at this point in the history
I am not sure how this was missed before. This change for sysvinit
writes the service logs out to /var/log/consul.log.

This should close #284 and close #290.
  • Loading branch information
John Bellone committed Mar 17, 2016
1 parent 28c19e7 commit 67c002d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion templates/default/sysvinit.service.erb
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ prog="<%= File.basename(@daemon) %>"
user="<%= @user %>"
exec="<%= @daemon %>"
pidfile="<%= @pid_file %>"
logfile="/var/log/$prog.log"
lockfile="/var/lock/subsys/$prog"

<%- @environment.each do |key, val| -%>
Expand Down Expand Up @@ -61,7 +62,7 @@ _start() {
daemon \
--pidfile=$pidfile \
--user=$user \
" { $exec <%= @daemon_options %> &> /dev/null & } ; echo \$! >| $pidfile "
" { $exec <%= @daemon_options %> &> $logfile & } ; echo \$! >| $pidfile "
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch $lockfile
Expand Down

0 comments on commit 67c002d

Please sign in to comment.