cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eev...@apache.org
Subject svn commit: r956078 - in /cassandra/trunk/contrib/redhat: ./ cassandra
Date Fri, 18 Jun 2010 18:23:19 GMT
Author: eevans
Date: Fri Jun 18 18:23:18 2010
New Revision: 956078

URL: http://svn.apache.org/viewvc?rev=956078&view=rev
Log:
redhat init script needed for rpm packaging

Patch by Peter Halliday; reviewed by eevans for CASSANDRA-1201

Added:
    cassandra/trunk/contrib/redhat/
    cassandra/trunk/contrib/redhat/cassandra

Added: cassandra/trunk/contrib/redhat/cassandra
URL: http://svn.apache.org/viewvc/cassandra/trunk/contrib/redhat/cassandra?rev=956078&view=auto
==============================================================================
--- cassandra/trunk/contrib/redhat/cassandra (added)
+++ cassandra/trunk/contrib/redhat/cassandra Fri Jun 18 18:23:18 2010
@@ -0,0 +1,47 @@
+#!/bin/bash
+#
+# /etc/init.d/cassandra
+#
+# Startup script for Cassandra
+# 
+# chkconfig: 2345 20 80
+# description: Starts and stops Cassandra
+
+. /etc/rc.d/init.d/functions
+
+export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/
+export CASSANDRA_HOME=/usr/share/cassandra/
+export CASSANDRA_INCLUDE=/usr/share/cassandra/cassandra.in.sh
+export CASSANDRA_CONF=/etc/cassandra/
+export CASSANDRA_OWNR=cassandra
+log_file=/var/log/cassandra/cassandra.log
+pid_file=/var/run/cassandra/cassandra.pid
+CASSANDRA_PROG=/usr/sbin/cassandra
+
+
+case "$1" in
+    start)
+        # Cassandra startup
+        echo -n "Starting Cassandra: "
+        su $CASSANDRA_OWNR -c "$CASSANDRA_PROG -p $pid_file" > $log_file 2>&1
+        echo "OK"
+        ;;
+    stop)
+        # Cassandra shutdown
+        echo -n "Shutdown Cassandra: "
+        su $CASSANDRA_OWNR -c "kill `cat $pid_file`"
+        echo "OK"
+        ;;
+    reload|restart)
+        $0 stop
+        $0 start
+        ;;
+    status)
+        ;;
+    *)
+        echo "Usage: `basename $0` start|stop|restart|reload"
+        exit 1
+esac
+
+exit 0
+



Mime
View raw message