On Wed, 14 Apr 2010 12:23:19 -0500 Eric Evans <[email protected]> wrote:
EE> On Wed, 2010-04-14 at 10:16 -0500, Ted Zlatanov wrote:
>> Can it support a non-root user through /etc/default/cassandra? I've
>> been patching the init script myself but was hoping this would be
>> standard.
EE> It's the first item on debian/TODO, but, you know, patches welcome and
EE> all that.
The appended patch has been sufficient for me. I have to override the
PIDFILE too, but that's a system issue. So my /etc/default/cassandra,
for example, is:
JAVA_HOME="/usr/lib/jvm/java-6-sun"
USER=cassandra
PIDFILE=/var/tmp/$NAME.pid
Ted
--- debian/init 2010-04-14 12:57:30.000000000 -0500
+++ /etc/init.d/cassandra 2010-04-14 13:00:25.000000000 -0500
@@ -21,6 +21,7 @@
JSVC=/usr/bin/jsvc
JVM_MAX_MEM="1G"
JVM_START_MEM="128M"
+USER=root
[ -e /usr/share/cassandra/apache-cassandra.jar ] || exit 0
[ -e /etc/cassandra/storage-conf.xml ] || exit 0
@@ -75,6 +76,7 @@
is_running && return 1
$JSVC \
+ -user $USER \
-home $JAVA_HOME \
-pidfile $PIDFILE \
-errfile "&1" \