From 25bcd76017ce16c12081d3b053522db95c232026 Mon Sep 17 00:00:00 2001 From: Takuya ASADA Date: Mon, 28 Sep 2020 17:21:59 +0900 Subject: [PATCH] install.sh: stop using symlinks for systemd units on nonroot mode On some environment, systemctl enable fails when we use symlink. So just directly copy systemd units to ~/.config/systemd/user, instead of creating symlink. See scylladb/scylla#7288 --- install.sh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/install.sh b/install.sh index adeea07..2d1fa9e 100755 --- a/install.sh +++ b/install.sh @@ -105,7 +105,7 @@ if ! $nonroot; then else retc="$rprefix/etc" rsysconfdir="$rprefix/$sysconfdir" - rsystemd="$retc/systemd" + rsystemd="$HOME/.config/systemd/user" fi install -d -m755 "$rsysconfdir" @@ -124,8 +124,8 @@ EnvironmentFile=$sysconfdir/scylla-jmx EOS fi else - install -d -m755 "$retc"/systemd/system/scylla-jmx.service.d - cat << EOS > "$retc"/systemd/system/scylla-jmx.service.d/nonroot.conf + install -d -m755 "$rsystemd"/scylla-jmx.service.d + cat << EOS > "$rsystemd"/scylla-jmx.service.d/nonroot.conf [Service] EnvironmentFile= EnvironmentFile=$retc/sysconfig/scylla-jmx @@ -135,11 +135,6 @@ User= Group= WorkingDirectory= EOS - if [ ! -d ~/.config/systemd/user/scylla-jmx.service.d ]; then - mkdir -p ~/.config/systemd/user/scylla-jmx.service.d - fi - ln -srf $rsystemd/scylla-jmx.service ~/.config/systemd/user/ - ln -srf "$retc"/systemd/system/scylla-jmx.service.d/nonroot.conf ~/.config/systemd/user/scylla-jmx.service.d fi install -m644 scylla-jmx-1.0.jar "$rprefix/jmx"