summaryrefslogtreecommitdiff
path: root/system/apache-cassandra/rc.cassandra
diff options
context:
space:
mode:
authorManlio Modugno <manliomodugno -# #- gmail-# #- com>2010-08-28 08:11:09 -0400
committerErik Hanson <erik@slackbuilds.org>2010-08-29 15:32:14 -0500
commit5a9d224e41583110b74c3ab46ebc68028acafed9 (patch)
treeec2d6caf6b6084668c9c1212e082b3dc21d9314b /system/apache-cassandra/rc.cassandra
parentd8a948f940ba04e4108ba54e1a604f4acc82b9dc (diff)
downloadslackbuilds-5a9d224e41583110b74c3ab46ebc68028acafed9.tar.gz
system/apache-cassandra: Added (distributed database)
Signed-off-by: dsomero <xgizzmo@slackbuilds.org>
Diffstat (limited to 'system/apache-cassandra/rc.cassandra')
-rw-r--r--system/apache-cassandra/rc.cassandra41
1 files changed, 41 insertions, 0 deletions
diff --git a/system/apache-cassandra/rc.cassandra b/system/apache-cassandra/rc.cassandra
new file mode 100644
index 0000000000..97a8e8f172
--- /dev/null
+++ b/system/apache-cassandra/rc.cassandra
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+set -e
+
+CASSANDRA_BIN_PATH="/opt/apache-cassandra/bin"
+PID_FILE="/var/run/cassandra.pid"
+
+stop_cassandra(){
+ kill `cat $PID_FILE`
+ rm -f $PID_FILE
+}
+
+if [ ! -d $CASSANDRA_BIN_PATH ]; then
+ echo
+ echo "Cassandra is not installed on this machine!"
+ echo "Please check cassandra installation or set var CASSANDRA_BIN_PATH properly"
+ echo
+ exit 1
+fi
+
+case $1 in
+ start)
+ echo " * Starting Cassandra..."
+ $CASSANDRA_BIN_PATH/cassandra -p $PID_FILE > /dev/null 2>&1
+ ;;
+ stop)
+ echo " * Stopping Cassandra..."
+ stop_cassandra
+ ;;
+ restart)
+ echo " * Rerstarting Cassandra..."
+ stop_cassandra
+ sleep 3
+ $CASSANDRA_BIN_PATH/cassandra -p $PID_FILE > /dev/null 2>&1
+ ;;
+ *)
+ echo " * Please provide correct option between start|stop|restart"
+ ;;
+esac
+
+