Merge "Add SCYLLA_HOME, SCYLLA_CONF for systemd/upstart" from Takuya

"Fixes scylladb/scylla#607.

Also it merges dist/common/scripts/jmx_run and scripts/scylla-jmx, and mark
sysconfig file as 'noreplace'."
This commit is contained in:
Pekka Enberg 2015-12-07 17:00:39 +02:00
commit bb209e8ce7
8 changed files with 24 additions and 16 deletions

View File

@ -1,5 +0,0 @@
#!/bin/sh -e
args="-Djava.net.preferIPv4Stack=true -Dcom.sun.management.jmxremote.port=$JMX_LOCAL_PORT -Dcom.sun.management.jmxremote.rmi.port=$JMX_LOCAL_PORT -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
exec java $args -jar /usr/lib/scylla/jmx/urchin-mbean-1.0.jar

View File

@ -1 +1,14 @@
JMX_LOCAL_PORT=7199
# The jmx port to open
JMX_PORT=7199
# The API port to connect to
API_PORT=10000
# The API address to connect to
ADDR=127.0.0.1
# scylla home dir
SCYLLA_HOME=/var/lib/scylla
# scylla config dir
SCYLLA_CONF=/etc/scylla

View File

@ -33,7 +33,7 @@ install -m644 dist/redhat/systemd/scylla-jmx.service $RPM_BUILD_ROOT%{_unitdir}/
install -d -m755 $RPM_BUILD_ROOT%{_prefix}/lib/scylla
install -d -m755 $RPM_BUILD_ROOT%{_prefix}/lib/scylla/jmx
install -m644 target/urchin-mbean-1.0.jar $RPM_BUILD_ROOT%{_prefix}/lib/scylla/jmx/
install -m755 dist/common/scripts/* $RPM_BUILD_ROOT%{_prefix}/lib/scylla/jmx
install -m755 scripts/scylla-jmx $RPM_BUILD_ROOT%{_prefix}/lib/scylla/jmx
%pre
/usr/sbin/groupadd scylla 2> /dev/null || :
@ -64,9 +64,9 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%{_sysconfdir}/sysconfig/scylla-jmx
%config(noreplace) %{_sysconfdir}/sysconfig/scylla-jmx
%{_unitdir}/scylla-jmx.service
%{_prefix}/lib/scylla/jmx/jmx_run
%{_prefix}/lib/scylla/jmx/scylla-jmx
%{_prefix}/lib/scylla/jmx/urchin-mbean-1.0.jar
%changelog

View File

@ -8,7 +8,7 @@ Type=simple
EnvironmentFile=/etc/sysconfig/scylla-jmx
User=scylla
Group=scylla
ExecStart=/usr/lib/scylla/jmx/jmx_run
ExecStart=/usr/lib/scylla/jmx/scylla-jmx -jp $JMX_PORT -p $API_PORT -a $ADDR -l /usr/lib/scylla/jmx
KillMode=process
Restart=always

View File

@ -20,7 +20,7 @@ override_dh_auto_install:
cp $(CURDIR)/NOTICE $(DOC)
mkdir -p $(DEST)
cp $(CURDIR)/dist/common/scripts/* $(DEST)
cp $(CURDIR)/scripts/scylla-jmx $(DEST)
cp $(CURDIR)/target/urchin-mbean-1.0.jar $(DEST)
%:

View File

@ -20,7 +20,6 @@ DESC="Scylla JMX server"
NAME=scylla-jmx
SCYLLA_JMX=scylla-jmx
DAEMON=/usr/lib/scylla/jmx/jmx_run
PIDFILE=/var/run/scylla-jmx.pid
SCRIPTNAME=/etc/init.d/$NAME
@ -30,7 +29,8 @@ SCRIPTNAME=/etc/init.d/$NAME
# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
export JMX_LOCAL_PORT
export SCYLLA_HOME SCYLLA_CONF
DAEMON=/usr/lib/scylla/jmx/scylla-jmx -jp $JMX_PORT -p $API_PORT -a $ADDR -l /usr/lib/scylla/jmx
# Define LSB log_* functions.
. /lib/lsb/init-functions

View File

@ -13,6 +13,6 @@ console log
script
. /etc/default/scylla-jmx
export JMX_LOCAL_PORT
exec /usr/lib/scylla/jmx/jmx_run
export SCYLLA_HOME SCYLLA_CONF
exec /usr/lib/scylla/jmx/scylla-jmx -jp $JMX_PORT -p $API_PORT -a $ADDR -l /usr/lib/scylla/jmx
end script

View File

@ -62,4 +62,4 @@ do
esac
done
java -Dapiaddress=$API_ADDR -Dapiport=$API_PORT -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=$JMX_PORT -Dcom.sun.management.jmxremote.rmi.port=$JMX_PORT -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -jar $LOCATION/urchin-mbean-1.0.jar
exec java -Dapiaddress=$API_ADDR -Dapiport=$API_PORT -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=$JMX_PORT -Dcom.sun.management.jmxremote.rmi.port=$JMX_PORT -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -jar $LOCATION/urchin-mbean-1.0.jar