install.sh: add --without-systemd option
Since we fail to write files to $USER/.config on Jenkins jobs, we need an option to skip installing systemd units. Let's add --without-systemd to do that. Also, to detect the option availability, we need to increment relocatable package version. See scylladb/scylla-dtest#2819
This commit is contained in:
parent
06f27357b4
commit
88d9bdc5b2
22
install.sh
22
install.sh
@ -32,6 +32,7 @@ Options:
|
|||||||
--nonroot shortcut of '--disttype nonroot'
|
--nonroot shortcut of '--disttype nonroot'
|
||||||
--sysconfdir /etc/sysconfig specify sysconfig directory name
|
--sysconfdir /etc/sysconfig specify sysconfig directory name
|
||||||
--packaging use install.sh for packaging
|
--packaging use install.sh for packaging
|
||||||
|
--without-systemd skip installing systemd units
|
||||||
--help this helpful message
|
--help this helpful message
|
||||||
EOF
|
EOF
|
||||||
exit 1
|
exit 1
|
||||||
@ -41,6 +42,7 @@ root=/
|
|||||||
sysconfdir=/etc/sysconfig
|
sysconfdir=/etc/sysconfig
|
||||||
nonroot=false
|
nonroot=false
|
||||||
packaging=false
|
packaging=false
|
||||||
|
without_systemd=false
|
||||||
|
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@ -64,6 +66,10 @@ while [ $# -gt 0 ]; do
|
|||||||
packaging=true
|
packaging=true
|
||||||
shift 1
|
shift 1
|
||||||
;;
|
;;
|
||||||
|
"--without-systemd")
|
||||||
|
without_systemd=true
|
||||||
|
shift 1
|
||||||
|
;;
|
||||||
"--help")
|
"--help")
|
||||||
shift 1
|
shift 1
|
||||||
print_usage
|
print_usage
|
||||||
@ -114,12 +120,16 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
install -d -m755 "$rsysconfdir"
|
install -d -m755 "$rsysconfdir"
|
||||||
install -d -m755 "$rsystemd"
|
if ! $without_systemd; then
|
||||||
|
install -d -m755 "$rsystemd"
|
||||||
|
fi
|
||||||
install -d -m755 "$rprefix/scripts" "$rprefix/jmx" "$rprefix/jmx/symlinks"
|
install -d -m755 "$rprefix/scripts" "$rprefix/jmx" "$rprefix/jmx/symlinks"
|
||||||
|
|
||||||
install -m644 dist/common/sysconfig/scylla-jmx -Dt "$rsysconfdir"
|
install -m644 dist/common/sysconfig/scylla-jmx -Dt "$rsysconfdir"
|
||||||
install -m644 dist/common/systemd/scylla-jmx.service -Dt "$rsystemd"
|
if ! $without_systemd; then
|
||||||
if ! $nonroot; then
|
install -m644 dist/common/systemd/scylla-jmx.service -Dt "$rsystemd"
|
||||||
|
fi
|
||||||
|
if ! $nonroot && ! $without_systemd; then
|
||||||
if [ "$sysconfdir" != "/etc/sysconfig" ]; then
|
if [ "$sysconfdir" != "/etc/sysconfig" ]; then
|
||||||
install -d -m755 "$retc"/systemd/system/scylla-jmx.service.d
|
install -d -m755 "$retc"/systemd/system/scylla-jmx.service.d
|
||||||
cat << EOS > "$retc"/systemd/system/scylla-jmx.service.d/sysconfdir.conf
|
cat << EOS > "$retc"/systemd/system/scylla-jmx.service.d/sysconfdir.conf
|
||||||
@ -128,7 +138,7 @@ EnvironmentFile=
|
|||||||
EnvironmentFile=$sysconfdir/scylla-jmx
|
EnvironmentFile=$sysconfdir/scylla-jmx
|
||||||
EOS
|
EOS
|
||||||
fi
|
fi
|
||||||
else
|
elif ! $without_systemd; then
|
||||||
install -d -m755 "$rsystemd"/scylla-jmx.service.d
|
install -d -m755 "$rsystemd"/scylla-jmx.service.d
|
||||||
cat << EOS > "$rsystemd"/scylla-jmx.service.d/nonroot.conf
|
cat << EOS > "$rsystemd"/scylla-jmx.service.d/nonroot.conf
|
||||||
[Service]
|
[Service]
|
||||||
@ -156,10 +166,10 @@ if $nonroot; then
|
|||||||
sed -i -e "s#/var/lib/scylla#$rprefix#g" "$rsysconfdir"/scylla-jmx
|
sed -i -e "s#/var/lib/scylla#$rprefix#g" "$rsysconfdir"/scylla-jmx
|
||||||
sed -i -e "s#/etc/scylla#$rprefix/etc/scylla#g" "$rsysconfdir"/scylla-jmx
|
sed -i -e "s#/etc/scylla#$rprefix/etc/scylla#g" "$rsysconfdir"/scylla-jmx
|
||||||
sed -i -e "s#/opt/scylladb/jmx#$rprefix/jmx#g" "$rsysconfdir"/scylla-jmx
|
sed -i -e "s#/opt/scylladb/jmx#$rprefix/jmx#g" "$rsysconfdir"/scylla-jmx
|
||||||
if check_usermode_support; then
|
if ! $without_systemd && check_usermode_support; then
|
||||||
systemctl --user daemon-reload
|
systemctl --user daemon-reload
|
||||||
fi
|
fi
|
||||||
echo "Scylla-JMX non-root install completed."
|
echo "Scylla-JMX non-root install completed."
|
||||||
elif ! $packaging; then
|
elif ! $without_systemd && ! $packaging; then
|
||||||
systemctl --system daemon-reload
|
systemctl --system daemon-reload
|
||||||
fi
|
fi
|
||||||
|
@ -45,9 +45,9 @@ args = ap.parse_args()
|
|||||||
output = args.dest
|
output = args.dest
|
||||||
|
|
||||||
ar = tarfile.open(output, mode='w|gz')
|
ar = tarfile.open(output, mode='w|gz')
|
||||||
# relocatable package format version = 2
|
# relocatable package format version = 2.2
|
||||||
with open('build/.relocatable_package_version', 'w') as f:
|
with open('build/.relocatable_package_version', 'w') as f:
|
||||||
f.write('2\n')
|
f.write('2.2\n')
|
||||||
ar.add('build/.relocatable_package_version', arcname='.relocatable_package_version')
|
ar.add('build/.relocatable_package_version', arcname='.relocatable_package_version')
|
||||||
|
|
||||||
pathlib.Path('build/SCYLLA-RELOCATABLE-FILE').touch()
|
pathlib.Path('build/SCYLLA-RELOCATABLE-FILE').touch()
|
||||||
|
Loading…
Reference in New Issue
Block a user