dist: change scylla-jmx process name from 'java' to 'scylla-jmx'

Helps in top, pgrep and friends.  Unfortunately the only reasonable way
to do it is to create a symlink to /usr/bin/java and run that.
Message-Id: <1463580254-8369-1-git-send-email-avi@scylladb.com>
This commit is contained in:
Avi Kivity 2016-05-18 17:04:14 +03:00 committed by Pekka Enberg
parent 2ff16fa2a5
commit f6710465ef
4 changed files with 9 additions and 1 deletions

View File

@ -32,8 +32,10 @@ install -m644 dist/common/sysconfig/scylla-jmx $RPM_BUILD_ROOT%{_sysconfdir}/sys
install -m644 dist/redhat/systemd/scylla-jmx.service $RPM_BUILD_ROOT%{_unitdir}/ 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
install -d -m755 $RPM_BUILD_ROOT%{_prefix}/lib/scylla/jmx install -d -m755 $RPM_BUILD_ROOT%{_prefix}/lib/scylla/jmx
install -d -m755 $RPM_BUILD_ROOT%{_prefix}/lib/scylla/jmx/symlinks
install -m644 target/scylla-jmx-1.0.jar $RPM_BUILD_ROOT%{_prefix}/lib/scylla/jmx/ install -m644 target/scylla-jmx-1.0.jar $RPM_BUILD_ROOT%{_prefix}/lib/scylla/jmx/
install -m755 scripts/scylla-jmx $RPM_BUILD_ROOT%{_prefix}/lib/scylla/jmx install -m755 scripts/scylla-jmx $RPM_BUILD_ROOT%{_prefix}/lib/scylla/jmx
ln -sf /usr/bin/java $RPM_BUILD_ROOT%{_prefix}/lib/scylla/jmx/symlinks/scylla-jmx
%pre %pre
/usr/sbin/groupadd scylla 2> /dev/null || : /usr/sbin/groupadd scylla 2> /dev/null || :
@ -68,6 +70,7 @@ rm -rf $RPM_BUILD_ROOT
%{_unitdir}/scylla-jmx.service %{_unitdir}/scylla-jmx.service
%{_prefix}/lib/scylla/jmx/scylla-jmx %{_prefix}/lib/scylla/jmx/scylla-jmx
%{_prefix}/lib/scylla/jmx/scylla-jmx-1.0.jar %{_prefix}/lib/scylla/jmx/scylla-jmx-1.0.jar
%{_prefix}/lib/scylla/jmx/symlinks/scylla-jmx
%changelog %changelog
* Fri Aug 7 2015 Takuya ASADA Takuya ASADA <syuu@cloudius-systems.com> * Fri Aug 7 2015 Takuya ASADA Takuya ASADA <syuu@cloudius-systems.com>

View File

@ -22,6 +22,8 @@ override_dh_auto_install:
mkdir -p $(DEST) mkdir -p $(DEST)
cp $(CURDIR)/scripts/scylla-jmx $(DEST) cp $(CURDIR)/scripts/scylla-jmx $(DEST)
cp $(CURDIR)/target/scylla-jmx-1.0.jar $(DEST) cp $(CURDIR)/target/scylla-jmx-1.0.jar $(DEST)
mkdir $(DEST)/symlinks
ln -sf /usr/bin/java $(DEST)/symlinks/scylla-jmx
override_dh_installinit: override_dh_installinit:
dh_installinit --no-start @@DH_INSTALLINIT@@ dh_installinit --no-start @@DH_INSTALLINIT@@

View File

@ -13,6 +13,7 @@ PARAM_API_PORT="-p"
PARAM_ADDR="-a" PARAM_ADDR="-a"
PARAM_LOCATION="-l" PARAM_LOCATION="-l"
LOCATION="target" LOCATION="target"
LOCATION_SCRIPTS="scripts"
PARAM_FILE="-cf" PARAM_FILE="-cf"
ALLOW_REMOTE="-r" ALLOW_REMOTE="-r"
ALLOW_DEBUG="-d" ALLOW_DEBUG="-d"
@ -61,6 +62,7 @@ do
;; ;;
"$PARAM_LOCATION") "$PARAM_LOCATION")
LOCATION=$2 LOCATION=$2
LOCATION_SCRIPTS="$2"
shift 2 shift 2
;; ;;
"$PARAM_FILE") "$PARAM_FILE")
@ -90,4 +92,4 @@ else
REMOTE="-Dcassandra.jmx.local.port=$JMX_PORT" REMOTE="-Dcassandra.jmx.local.port=$JMX_PORT"
fi fi
exec java $API_ADDR $API_PORT $DEBUG $CONF_FILE $REMOTE -Xmx256m -XX:+UseSerialGC -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -jar $LOCATION/scylla-jmx-1.0.jar exec "$LOCATION_SCRIPTS"/symlinks/scylla-jmx $API_ADDR $API_PORT $DEBUG $CONF_FILE $REMOTE -Xmx256m -XX:+UseSerialGC -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -jar $LOCATION/scylla-jmx-1.0.jar

1
scripts/symlinks/scylla-jmx Symbolic link
View File

@ -0,0 +1 @@
/usr/bin/java