Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix debian init #137

Merged
merged 2 commits into from
Jun 18, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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