Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix offline installation #131

Merged
merged 2 commits into from
Sep 7, 2020
Merged

fix offline installation #131

merged 2 commits into from
Sep 7, 2020

Conversation

amoskong
Copy link
Contributor

@amoskong amoskong commented Aug 26, 2020

Currently after offline installation, the scylla-jmx fails to be started.
This patch fixed the problem.

Fixes: scylladb/scylladb#7098 by [PATCH] install.sh: check both openjdk-8 and openjdk-11

Fixes: #129 by [PATCH] nonroot.conf: set WorkingDirectory to empty

@amoskong amoskong requested a review from penberg as a code owner August 26, 2020 08:16
@avikivity avikivity requested a review from syuu1228 August 26, 2020 08:27
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 <[email protected]>
@amoskong
Copy link
Contributor Author

Append a patch to fix #132

  • [PATCH] nonroot.conf: use customized sysconfdir in env file path

install.sh Outdated Show resolved Hide resolved
@penberg
Copy link
Contributor

penberg commented Aug 27, 2020

@syuu1228 Please review this.

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 <[email protected]>
Copy link
Contributor

@syuu1228 syuu1228 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we shouldn't apply $sysconfdir = /etc/default on nonroot mode.
Why we want to use it on Debian variants is it's distribution's default sysconfig dir.
On nonroot mode we uses $prefix/$sysconfdir, it's not /etc/default directory anyway, so no reason to apply the directory name here.
I suppose just always use $prefix/etc/sysconfig is fine for nonroot mode.

The env file path in nonroot.conf is /home/scylla-test/scylladb/etc/sysconfig/scylla-jmx.
Actually it's installed to /home/scylla-test/scylladb/etc/default/scylla-jmx,
because the special sysconfdir is assigned in install commandline.

@syuu1228
Copy link
Contributor

Other changes looks okay to me.

@amoskong
Copy link
Contributor Author

I think we shouldn't apply $sysconfdir = /etc/default on nonroot mode.
Why we want to use it on Debian variants is it's distribution's default sysconfig dir.
On nonroot mode we uses $prefix/$sysconfdir, it's not /etc/default directory anyway, so no reason to apply the directory name here.
I suppose just always use $prefix/etc/sysconfig is fine for nonroot mode.

If sysconfdir isn't assigned, $prefix/etc/sysconfig == $retc/../$sysconfig
If sysconfdir is assigned, my change will still work.

The env file path in nonroot.conf is /home/scylla-test/scylladb/etc/sysconfig/scylla-jmx.
Actually it's installed to /home/scylla-test/scylladb/etc/default/scylla-jmx,
because the special sysconfdir is assigned in install commandline.

OK, I got it. You expect the syscondir is only assigned for root install of debian-like distros.
It should not be assigned for nonroot install of debian-like distros.
The limit should be added to parameters parser of install.sh

I'm fine to use default sysconfdir for nonroot install of debian-like distros. So I will remove the last patch. Then we can merge this PR.

Thanks for your review.

@amoskong amoskong changed the base branch from master to next August 31, 2020 02:09
@amoskong amoskong changed the base branch from next to master August 31, 2020 02:13
@amoskong amoskong requested a review from syuu1228 August 31, 2020 02:34
Copy link
Contributor

@syuu1228 syuu1228 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@penberg penberg merged commit 12ab6aa into scylladb:master Sep 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

scylla-jmx failed to start after offline installation install.sh: openjdk-11 isn't checked for dependency
3 participants