Skip to content

Commit

Permalink
Merge pull request twitter#292 from zwChan/master
Browse files Browse the repository at this point in the history
Check the configuration before start in the nutcracker.init script.
  • Loading branch information
manjuraj committed Dec 18, 2014
2 parents 139c527 + 1f1c7d4 commit 9cf0e3a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions scripts/nutcracker.init
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ prog="nutcracker"

start () {
echo -n $"Starting $prog: "
#Test the config before start.
daemon --user ${USER} ${prog} $OPTIONS -t >/dev/null 2>&1
RETVAL=$?
if [ $RETVAL -ne 0 ] ; then
echo "Config check fail! Please use 'nutcracker -c /etc/nutcracker/nutcracker.yml' for detail."
echo_failure;
echo;
exit 1
fi

daemon --user ${USER} ${prog} $OPTIONS
RETVAL=$?
echo
Expand Down

0 comments on commit 9cf0e3a

Please sign in to comment.