4.5. Registration/Deletion to Linux Daemon¶
In this section the registration/deletion methods of Cassandra to Linux Daemon are described.
4.5.1. Registration to Linux Daemon¶
Please create the contents below as /etc/init.d/cassandra, and give the execution authority.
# chkconfig: 345 99 1 # description: cassandra # processname: cassandra #!/bin/sh CASSANDRA_BIN=/usr/local/cassandra/bin/cassandra CASSANDRA_PID=/var/run/cassandra.pid case "$1" in start) $CASSANDRA_BIN -p $CASSANDRA_PID echo "Running Cassandra" ;; stop) kill `cat $CASSANDRA_PID` rm -f $CASSANDRA_PID echo "Stopped Cassandra" ;; *) echo "Usage: $0 {start|stop}" exit 1 esac exit 0Please execute the chkconfig command below, and make it work automatically at startup time.
# chkconfig --add cassandraPlease execute the chkconfig command below. It is successful if the information below is displayed.
# chkconfig --list cassandra cassandra 0:off 1:off 2:off 3:on 4:on 5:on 6:off
4.5.2. Deletion from Linux Daemon¶
Please execute the command below, and delete it.
# chkconfig --del cassandraPlease execute the chkconfig command below. It is successful if the information below is displayed
# chkconfig --list cassandra Service cassandra supports chkconfig, but there was no reference at the execution level (run 'chkconfig --add cassandra').Please delete /etc/init.d/cassandra if required.