Commit | Line | Data |
---|---|---|
209feeb0 H |
1 | #!/bin/bash |
2 | daemon_name=riak | |
3 | riak_bin='/usr/bin/riak'; | |
4 | ||
5 | . /etc/rc.conf | |
6 | . /etc/rc.d/functions | |
7 | ||
8 | case "$1" in | |
9 | console|attach|'') | |
10 | "$riak_bin" $@; | |
11 | exit $?; | |
12 | ;; | |
13 | esac | |
14 | ||
15 | stat_busy "$1""ing $daemon_name daemon" | |
16 | ||
17 | err=$("$riak_bin" $@ 2>&1); ret=$?; | |
18 | echo "$err" | egrep -i '(not responding|already running)' >/dev/null && ret=10; | |
19 | ||
20 | [ $ret -gt 0 ] && { | |
21 | stat_fail; | |
22 | echo "$err"; | |
23 | exit 1; | |
24 | } | |
25 | ||
26 | case "$1" in | |
27 | start|restart) | |
28 | add_daemon $daemon_name | |
29 | ;; | |
30 | stop) | |
31 | rm_daemon $daemon_name | |
32 | ;; | |
33 | esac | |
34 | ||
35 | stat_done; | |
36 | echo "$err"; | |
37 | exit 0; |