install.sh: stop using symlinks for systemd units on nonroot mode
On some environment, systemctl enable <service> fails when we use symlink. So just directly copy systemd units to ~/.config/systemd/user, instead of creating symlink. See scylladb/scylla#7288
This commit is contained in:
parent
45e4f28766
commit
25bcd76017
11
install.sh
11
install.sh
|
@ -105,7 +105,7 @@ if ! $nonroot; then
|
||||||
else
|
else
|
||||||
retc="$rprefix/etc"
|
retc="$rprefix/etc"
|
||||||
rsysconfdir="$rprefix/$sysconfdir"
|
rsysconfdir="$rprefix/$sysconfdir"
|
||||||
rsystemd="$retc/systemd"
|
rsystemd="$HOME/.config/systemd/user"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
install -d -m755 "$rsysconfdir"
|
install -d -m755 "$rsysconfdir"
|
||||||
|
@ -124,8 +124,8 @@ EnvironmentFile=$sysconfdir/scylla-jmx
|
||||||
EOS
|
EOS
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
install -d -m755 "$retc"/systemd/system/scylla-jmx.service.d
|
install -d -m755 "$rsystemd"/scylla-jmx.service.d
|
||||||
cat << EOS > "$retc"/systemd/system/scylla-jmx.service.d/nonroot.conf
|
cat << EOS > "$rsystemd"/scylla-jmx.service.d/nonroot.conf
|
||||||
[Service]
|
[Service]
|
||||||
EnvironmentFile=
|
EnvironmentFile=
|
||||||
EnvironmentFile=$retc/sysconfig/scylla-jmx
|
EnvironmentFile=$retc/sysconfig/scylla-jmx
|
||||||
|
@ -135,11 +135,6 @@ User=
|
||||||
Group=
|
Group=
|
||||||
WorkingDirectory=
|
WorkingDirectory=
|
||||||
EOS
|
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
|
fi
|
||||||
|
|
||||||
install -m644 scylla-jmx-1.0.jar "$rprefix/jmx"
|
install -m644 scylla-jmx-1.0.jar "$rprefix/jmx"
|
||||||
|
|
Loading…
Reference in New Issue