Skip to content

Commit

Permalink
Merge pull request #137 from dizzythinks/fix_debian_init
Browse files Browse the repository at this point in the history
Fix debian init
  • Loading branch information
solarkennedy committed Jun 18, 2015
2 parents c5176ff + bf72177 commit b632fef
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions templates/consul.debian.erb
Original file line number Diff line number Diff line change
Expand Up @@ -52,31 +52,27 @@ do_start()
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
echo "Starting consul and backgrounding"
mkrundir
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --chuid $USER --background --make-pidfile --test > /dev/null \
|| return 1
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --chuid $USER --background --make-pidfile -- \
$DAEMON_ARGS \
|| return 2

echo -n "Waiting for consul daemon to be listening..."
for i in `seq 1 30`; do
if ! start-stop-daemon --quiet --stop --test --pidfile $PIDFILE --exec $DAEMON --user $USER; then
echo " FAIL: consul process died"
return 2
RETVAL=2
sleep 1
continue
fi
if "$DAEMON" info >/dev/null; then
echo " OK"
return 0
fi
echo -n .
sleep 1
done
echo " FAIL: consul process is alive, but is not listening."
return 2
return "$RETVAL"
}


#
# Function that stops the daemon/service
#
Expand Down

0 comments on commit b632fef

Please sign in to comment.