Skip to content

Commit cd61082

Browse files
authored
Merge pull request #10 from bsphere/master
trap SIGTERM and SIGINT and gracefully stop riak
2 parents a2f9b73 + d074d01 commit cd61082

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ RUN mkdir -p /etc/riak/schemas
151151
152152
WORKDIR /var/lib/riak
153153
154-
CMD $RIAK_HOME/riak-cluster.sh
154+
CMD ["$RIAK_HOME/riak-cluster.sh"]
155155
156156
# Clean up APT cache
157157
RUN rm -rf /var/lib/apt/lists/* /tmp/*

riak-cluster.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,11 @@ $RIAK_ADMIN wait-for-service riak_kv
4646
# Run all poststart scripts
4747
POSTSTART=$(find /etc/riak/poststart.d -name *.sh -print | sort)
4848
for s in $POSTSTART; do
49-
. $s
49+
. $
5050
done
5151

52-
# Tail the log file indefinitely
53-
tail -n 1024 -f /var/log/riak/console.log
52+
# Trap SIGTERM and SIGINT and tail the log file indefinitely
53+
tail -n 1024 -f /var/log/riak/console.log &
54+
PID=$!
55+
trap "$RIAK stop; kill $PID" SIGTERM SIGINT
56+
wait $PID

0 commit comments

Comments
 (0)