ports/160428: [PATCH] databases/cassandra: [fixed startup script]
Radim Kolar
hsn at sendmail.cz
Sat Sep 3 15:00:26 UTC 2011
>Number: 160428
>Category: ports
>Synopsis: [PATCH] databases/cassandra: [fixed startup script]
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Sat Sep 03 15:00:21 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator: Radim Kolar
>Release: FreeBSD 8.2-RELEASE i386
>Organization:
>Environment:
System: FreeBSD fbsd8.localdomain 8.2-RELEASE FreeBSD 8.2-RELEASE #8: Tue Mar 1 14:49:07 CET
>Description:
1. startup script fixed
cassandra didnt come up after boot due to PATH issues
added REQUIRE: LOGIN to startup script
2. cassandra commands - cassandra-cli and nodetool made available to user
without need to change PATH
3. removed stop-server script. It was not used
Port maintainer (gslin at gslin.org) is cc'd.
Generated with FreeBSD Port Tools 0.99
>How-To-Repeat:
>Fix:
--- cassandra-0.8.4_1.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/databases/cassandra/Makefile /home/hsn/ports/cassandra/Makefile
--- /usr/ports/databases/cassandra/Makefile 2011-09-03 07:19:20.000000000 +0200
+++ /home/hsn/ports/cassandra/Makefile 2011-09-03 16:44:43.881599178 +0200
@@ -7,6 +7,7 @@
PORTNAME= cassandra
PORTVERSION= 0.8.4
+PORTREVISION= 1
CATEGORIES= databases java
MASTER_SITES= ${MASTER_SITE_APACHE}
MASTER_SITE_SUBDIR= cassandra/${PORTVERSION}
@@ -26,6 +27,11 @@
log4j-tools.properties passwd.properties \
cassandra-topology.properties
+do-patch:
+ @${REINPLACE_CMD} -e 's|/usr/share/cassandra|${DATADIR}/bin|' ${WRKSRC}/bin/nodetool ${WRKSRC}/bin/cassandra-cli
+ @${REINPLACE_CMD} -e 's|\`dirname \$$\0\`/..|${DATADIR}|' ${WRKSRC}/bin/cassandra.in.sh
+ @${RM} -f ${WRKSRC}/bin/*.bak
+
do-build:
.for i in ${CONFIGS}
@${MV} ${WRKSRC}/conf/${i} ${WRKSRC}/conf/${i}.sample
@@ -34,7 +40,9 @@
do-install:
@${MKDIR} ${DATADIR}
@${CP} -R ${WRKSRC}/* ${DATADIR}
- @${RM} ${DATADIR}/bin/*.bat
+ @${RM} ${DATADIR}/bin/*.bat ${DATADIR}/bin/stop-server
+ @${LN} -s ${DATADIR}/bin/nodetool ${PREFIX}/bin/nodetool
+ @${LN} -s ${DATADIR}/bin/cassandra-cli ${PREFIX}/bin/cassandra-cli
post-install:
@PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
diff -ruN --exclude=CVS /usr/ports/databases/cassandra/files/cassandra.in /home/hsn/ports/cassandra/files/cassandra.in
--- /usr/ports/databases/cassandra/files/cassandra.in 2011-09-03 07:19:20.000000000 +0200
+++ /home/hsn/ports/cassandra/files/cassandra.in 2011-09-03 15:47:37.293336771 +0200
@@ -25,6 +25,7 @@
# DAMAGE.
# PROVIDE: cassandra
+# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# $FreeBSD: ports/databases/cassandra/files/cassandra.in,v 1.1 2011/09/03 05:19:20 sunpoet Exp $
@@ -32,6 +33,8 @@
. /etc/rc.subr
name="cassandra"
+rcvar=`set_rcvar`
+load_rc_config $name
cassandra_enable=${cassandra_enable:-"NO"}
cassandra_vmargs=${cassandra_vmargs:-"-XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:+CMSIncrementalPacing -XX:CMSIncrementalDutyCycleMin=0 -XX:+CMSIncrementalDutyCycle=10"}
@@ -42,8 +45,8 @@
procname="java"
pidfile=/var/run/cassandra.pid
-rcvar=`set_rcvar`
-load_rc_config $name
export MAX_HEAP_SIZE="$cassandra_memory"
export HEAP_NEWSIZE="$cassandra_newgen"
+export PATH=$PATH:%%LOCALBASE%%/bin
+
run_rc_command "$1"
diff -ruN --exclude=CVS /usr/ports/databases/cassandra/pkg-plist /home/hsn/ports/cassandra/pkg-plist
--- /usr/ports/databases/cassandra/pkg-plist 2011-09-03 07:19:20.000000000 +0200
+++ /home/hsn/ports/cassandra/pkg-plist 2011-09-03 15:51:57.678029268 +0200
@@ -1,4 +1,6 @@
@comment $FreeBSD: ports/databases/cassandra/pkg-plist,v 1.11 2011/09/03 05:19:20 sunpoet Exp $
+bin/cassandra-cli
+bin/nodetool
%%DATADIR%%/CHANGES.txt
%%DATADIR%%/LICENSE.txt
%%DATADIR%%/NEWS.txt
@@ -12,7 +14,6 @@
%%DATADIR%%/bin/sstable2json
%%DATADIR%%/bin/sstablekeys
%%DATADIR%%/bin/sstableloader
-%%DATADIR%%/bin/stop-server
%%DATADIR%%/conf/README.txt
%%DATADIR%%/conf/access.properties.sample
%%DATADIR%%/conf/cassandra-env.sh
--- cassandra-0.8.4_1.patch ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list