From 6311525346c8d3b878ea78768b294fa5ba6c4854 Mon Sep 17 00:00:00 2001 From: Amos Kong Date: Wed, 26 Aug 2020 10:45:38 +0800 Subject: [PATCH 1/2] nonroot.conf: set WorkingDirectory to empty MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After offline installation, scylla-jmx fails to be started for a chdir error. WorkingDirectory is set to /var/lib/scylla in scylla-jmx.service, it doesn't exist in nonroot install. This patch solved the problem by setting WorkingDirectory to empty in nonroot.conf. $ systemctl --user status scylla-jmx ● scylla-jmx.service - Scylla JMX Loaded: loaded (/home/scylla-test/.config/systemd/user/../../../scylladb/etc/systemd/scylla-jmx.service; linked; vendor preset: enabled) Drop-In: /home/scylla-test/.config/systemd/user/scylla-jmx.service.d └─nonroot.conf Active: failed (Result: exit-code) since Wed 2020-08-26 15:19:56 UTC; 2s ago Process: 66955 ExecStart=/home/scylla-test/install_root/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 (code=exited, status=200/CHDIR) Main PID: 66955 (code=exited, status=200/CHDIR) systemd[5654]: Started Scylla JMX. systemd[66955]: scylla-jmx.service: Changing to the requested working directory failed: No such file or directory systemd[66955]: scylla-jmx.service: Failed at step CHDIR spawning /home/scylla-test/scylladb/jmx/scylla-jmx: No such file or directory systemd[5654]: scylla-jmx.service: Main process exited, code=exited, status=200/CHDIR systemd[5654]: scylla-jmx.service: Failed with result 'exit-code'. Signed-off-by: Amos Kong --- install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install.sh b/install.sh index 20ecb8f..bd22499 100755 --- a/install.sh +++ b/install.sh @@ -133,6 +133,7 @@ ExecStart= ExecStart=$rprefix/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 User= Group= +WorkingDirectory= EOS if [ ! -d ~/.config/systemd/user/scylla-jmx.service.d ]; then mkdir -p ~/.config/systemd/user/scylla-jmx.service.d From d998ac2e1e5ac4df46e8d745b5965212d4adc953 Mon Sep 17 00:00:00 2001 From: Amos Kong Date: Wed, 26 Aug 2020 10:44:46 +0800 Subject: [PATCH 2/2] install.sh: check both openjdk-8 and openjdk-11 On Debian10, only Openjdk-11 is available, the install.sh fails in java checking. Openjdk-8 and Openjdk-11 all work well, we should check both of them. This patch also fixed the error message. Signed-off-by: Amos Kong --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index bd22499..adeea07 100755 --- a/install.sh +++ b/install.sh @@ -78,12 +78,12 @@ if ! $packaging; then has_java=false if [ -x /usr/bin/java ]; then javaver=$(/usr/bin/java -version 2>&1|head -n1|cut -f 3 -d " ") - if [[ "$javaver" =~ ^\"1.8.0 ]]; then + if [[ "$javaver" =~ ^\"1.8.0 || "$javaver" =~ ^\"11.0. ]]; then has_java=true fi fi if ! $has_java; then - echo "Please install openjdk-8 before running install.sh." + echo "Please install openjdk-8 or openjdk-11 before running install.sh." exit 1 fi fi