From f73da49f6218bea09b18d115f623bab2386a13fc Mon Sep 17 00:00:00 2001 From: Takuya ASADA Date: Tue, 18 Jun 2019 21:24:51 +0900 Subject: [PATCH] dist: merge /usr/lib/scylla to /opt/scylladb Since scylla-jmx uses /usr/lib/scylla/jmx for program directory, we also need to move them under /opt/scylladb. Signed-off-by: Takuya ASADA Message-Id: <20190618122451.27721-1-syuu@scylladb.com> --- dist/common/sysconfig/scylla-jmx | 2 +- .../systemd/scylla-jmx.service.mustache | 2 +- dist/debian/rules.mustache | 8 +++++-- dist/redhat/scylla-jmx.spec.mustache | 24 +++++++++++-------- 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/dist/common/sysconfig/scylla-jmx b/dist/common/sysconfig/scylla-jmx index 2a634ab..e35244a 100644 --- a/dist/common/sysconfig/scylla-jmx +++ b/dist/common/sysconfig/scylla-jmx @@ -20,7 +20,7 @@ SCYLLA_CONF=/etc/scylla #SCYLLA_JMX_FILE="-cf /etc/scylla.d/scylla-user.cfg" # The location of the jmx proxy jar file -SCYLLA_JMX_LOCAL="-l /usr/lib/scylla/jmx" +SCYLLA_JMX_LOCAL="-l /opt/scylladb/jmx" # allow to run remotely #SCYLLA_JMX_REMOTE="-r" diff --git a/dist/common/systemd/scylla-jmx.service.mustache b/dist/common/systemd/scylla-jmx.service.mustache index 6c0413e..4e1dd6e 100644 --- a/dist/common/systemd/scylla-jmx.service.mustache +++ b/dist/common/systemd/scylla-jmx.service.mustache @@ -13,7 +13,7 @@ EnvironmentFile=/etc/sysconfig/scylla-jmx {{/redhat}} User=scylla Group=scylla -ExecStart=/usr/lib/scylla/jmx/scylla-jmx $SCYLLA_JMX_PORT $SCYLLA_API_PORT $SCYLLA_API_ADDR $SCYLLA_JMX_ADDR $SCYLLA_JMX_FILE $SCYLLA_JMX_LOCAL $SCYLLA_JMX_REMOTE $SCYLLA_JMX_DEBUG +ExecStart=/opt/scylladb/jmx/scylla-jmx $SCYLLA_JMX_PORT $SCYLLA_API_PORT $SCYLLA_API_ADDR $SCYLLA_JMX_ADDR $SCYLLA_JMX_FILE $SCYLLA_JMX_LOCAL $SCYLLA_JMX_REMOTE $SCYLLA_JMX_DEBUG KillMode=process Restart=on-abnormal diff --git a/dist/debian/rules.mustache b/dist/debian/rules.mustache index 29248b4..b527d7e 100755 --- a/dist/debian/rules.mustache +++ b/dist/debian/rules.mustache @@ -1,7 +1,7 @@ #!/usr/bin/make -f -DOC = $(CURDIR)/debian/{{product}}-jmx/usr/share/doc/{{product}}-jmx -DEST = $(CURDIR)/debian/{{product}}-jmx/usr/lib/scylla/jmx +DOC = $(CURDIR)/debian/{{product}}-jmx/opt/scylladb/share/doc/{{product}}-jmx +DEST = $(CURDIR)/debian/{{product}}-jmx/opt/scylladb/jmx M2_REPO= $(CURDIR)/m2 override_dh_auto_build: @@ -23,6 +23,10 @@ override_dh_auto_install: mkdir $(DEST)/symlinks ln -sf /usr/bin/java $(DEST)/symlinks/scylla-jmx + mkdir -p $(CURDIR)/debian/{{product}}-jmx/opt/scylladb/scripts + # Create symlink for /usr/lib/scylla/jmx + ln -sf /opt/scylladb/jmx $(CURDIR)/debian/{{product}}-jmx/opt/scylladb/scripts/ + override_dh_installinit: {{#scylla}} dh_installinit --no-start diff --git a/dist/redhat/scylla-jmx.spec.mustache b/dist/redhat/scylla-jmx.spec.mustache index 5f9b997..a465f76 100644 --- a/dist/redhat/scylla-jmx.spec.mustache +++ b/dist/redhat/scylla-jmx.spec.mustache @@ -29,16 +29,19 @@ pystache dist/common/systemd/scylla-jmx.service.mustache "{ $MUSTACHE_DIST }" > rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ mkdir -p $RPM_BUILD_ROOT%{_unitdir} -mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/scylla/ +mkdir -p $RPM_BUILD_ROOT/opt/scylladb/ install -m644 dist/common/sysconfig/scylla-jmx $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ install -m644 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 -d -m755 $RPM_BUILD_ROOT%{_prefix}/lib/scylla/jmx/symlinks -install -m644 scylla-jmx-1.0.jar $RPM_BUILD_ROOT%{_prefix}/lib/scylla/jmx/ -install -m755 scylla-jmx $RPM_BUILD_ROOT%{_prefix}/lib/scylla/jmx -ln -sf /usr/bin/java $RPM_BUILD_ROOT%{_prefix}/lib/scylla/jmx/symlinks/scylla-jmx +install -d -m755 $RPM_BUILD_ROOT/opt/scylladb/ +install -d -m755 $RPM_BUILD_ROOT/opt/scylladb/jmx +install -d -m755 $RPM_BUILD_ROOT/opt/scylladb/jmx/symlinks +install -m644 scylla-jmx-1.0.jar $RPM_BUILD_ROOT/opt/scylladb/jmx/ +install -m755 scylla-jmx $RPM_BUILD_ROOT/opt/scylladb/jmx +ln -sf /usr/bin/java $RPM_BUILD_ROOT/opt/scylladb/jmx/symlinks/scylla-jmx +install -d -m755 $RPM_BUILD_ROOT/opt/scylladb/scripts +# create symlink for /usr/lib/scylla/jmx +ln -sf /opt/scylladb/jmx $RPM_BUILD_ROOT/opt/scylladb/scripts/ %pre /usr/sbin/groupadd scylla 2> /dev/null || : @@ -71,9 +74,10 @@ rm -rf $RPM_BUILD_ROOT %config(noreplace) %{_sysconfdir}/sysconfig/scylla-jmx %{_unitdir}/scylla-jmx.service -%{_prefix}/lib/scylla/jmx/scylla-jmx -%{_prefix}/lib/scylla/jmx/scylla-jmx-1.0.jar -%{_prefix}/lib/scylla/jmx/symlinks/scylla-jmx +/opt/scylladb/jmx/scylla-jmx +/opt/scylladb/jmx/scylla-jmx-1.0.jar +/opt/scylladb/jmx/symlinks/scylla-jmx +/opt/scylladb/scripts/jmx %changelog * Fri Aug 7 2015 Takuya ASADA Takuya ASADA