From e80a5e3cb319fc80c669d6d75f5abeb0d781758b Mon Sep 17 00:00:00 2001 From: Fred de Villamil Date: Wed, 27 Sep 2017 10:52:36 +0200 Subject: [PATCH] Make more configuration options available for sysconfig Using systemd to run scylla-jmx won't load params from /etc/defaults/scylla-jmx because it expects params to be sent using the command line. This patch enhances the sysconfig file by adding the available options (commented) and passes the right options to systemd `ExecStart` when defined. That way scylla-jmx is ran with the params defined into /etc/defaults/scylla-jmx. Maybe not the most elegant way to do it, but 1/ it works 2/ I didn't find a better solution to fix that problem. Message-Id: <20170927085236.6704-1-fdevillamil@synthesio.com> --- dist/common/sysconfig/scylla-jmx | 26 +++++++++++++++++++++++ dist/common/systemd/scylla-jmx.service.in | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/dist/common/sysconfig/scylla-jmx b/dist/common/sysconfig/scylla-jmx index 6f1f07d..e15829a 100644 --- a/dist/common/sysconfig/scylla-jmx +++ b/dist/common/sysconfig/scylla-jmx @@ -3,3 +3,29 @@ SCYLLA_HOME=/var/lib/scylla # scylla config dir SCYLLA_CONF=/etc/scylla + +SCYLLA_PARAMS="" + +# The jmx port to open +# SCYLLA_PARAMS="${SCYLLA_PARAMS } -jp 7199" + +# The API port to connect to +# SCYLLA_PARAMS="${SCYLLA_PARAMS} -p 12345" + +# API address to connect to +# SCYLLA_PARAMS="${SCYLLA_PARAMS} -a `hostname`" + +# use alternate jmx address +# SCYLLA_PARAMS="${SCYLLA_PARAMS} -ja `hostname`" + +# A configuration file to use +# SCYLLA_PARAMS="${SCYLLA_PARAMS} -cf /etc/scylla.d/scylla-user.cfg" + +# The location of the jmx proxy jar file +# SCYLLA_PARAMS="${SCYLLA_PARAMS} target /some/scripts" + +# allow to run remotely +# SCYLLA_PARAMS="${SCYLLA_PARAMS} -r" + +# allow debug +# SCYLLA_PARAMS="${SCYLLA_PARAMS} -d" diff --git a/dist/common/systemd/scylla-jmx.service.in b/dist/common/systemd/scylla-jmx.service.in index a9a3c2b..758dc66 100644 --- a/dist/common/systemd/scylla-jmx.service.in +++ b/dist/common/systemd/scylla-jmx.service.in @@ -8,7 +8,7 @@ Type=simple EnvironmentFile=@@SYSCONFDIR@@/scylla-jmx User=scylla Group=scylla -ExecStart=/usr/lib/scylla/jmx/scylla-jmx -l /usr/lib/scylla/jmx +ExecStart=/usr/lib/scylla/jmx/scylla-jmx -l /usr/lib/scylla/jmx ${SCYLLA_PARAMS} KillMode=process Restart=on-abnormal