Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed problem in Cassandra init script #134

Merged
merged 1 commit into from Jan 14, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 7 additions & 20 deletions ci_environment/cassandra/templates/default/cassandra.init.erb
Expand Up @@ -105,7 +105,7 @@ classpath()
# process is not running but the pidfile exists (to match the exit codes for
# the "status" command; see LSB core spec 3.1, section 20.2)
#
CMD_PATT="-user.cassandra.+CassandraDaemon"
CMD_PATT="cassandra.+CassandraDaemon"
is_running()
{
if [ -f $PIDFILE ]; then
Expand All @@ -130,23 +130,9 @@ do_start()
ulimit -l unlimited
ulimit -n "$FD_LIMIT"

cp=`classpath`
cassandra_home=`getent passwd cassandra | awk -F ':' '{ print $6; }'`
cd / # jsvc doesn't chdir() for us

# echo "Classpath is $cp"
$JSVC \
-user cassandra \
-home $JAVA_HOME \
-pidfile $PIDFILE \
-errfile "&1" \
-outfile /var/log/$NAME/output.log \
-cp $cp \
-Dlog4j.configuration=log4j-server.properties \
-XX:HeapDumpPath="$cassandra_home/java_`date +%s`.hprof" \
-XX:ErrorFile="$cassandra_home/hs_err_`date +%s`.log" \
$JVM_OPTS \
org.apache.cassandra.thrift.CassandraDaemon
cd /

start_daemon -p $PIDFILE $CASSANDRA_HOME/bin/cassandra -p $PIDFILE

is_running && return 0
for tries in `seq $WAIT_FOR_START`; do
Expand All @@ -167,8 +153,9 @@ do_stop()
# 2 if daemon could not be stopped
# other if a failure occurred
is_running || return 1
$JSVC -stop -home $JAVA_HOME -pidfile $PIDFILE \
org.apache.cassandra.thrift.CassandraDaemon

killproc -p $PID

is_running && return 2 || return 0
}

Expand Down