updated on Sun Jan 15 04:04:02 UTC 2012
[aur-mirror.git] / riak / riak.rc
blob71d6a2c0fd0d0ec23544586834f5146576b31ff0
1 #!/bin/bash
2 daemon_name=riak
3 riak_bin='/usr/bin/riak';
5 . /etc/rc.conf
6 . /etc/rc.d/functions
8 case "$1" in
9 console|attach|'')
10 "$riak_bin" $@;
11 exit $?;
13 esac
15 stat_busy "$1""ing $daemon_name daemon"
17 err=$("$riak_bin" $@ 2>&1); ret=$?;
18 echo "$err" | egrep -i '(not responding|already running)' >/dev/null && ret=10;
20 [ $ret -gt 0 ] && {
21 stat_fail;
22 echo "$err";
23 exit 1;
26 case "$1" in
27 start|restart)
28 add_daemon $daemon_name
30 stop)
31 rm_daemon $daemon_name
33 esac
35 stat_done;
36 echo "$err";
37 exit 0;