install.sh: fix more incorrect permission on strict umask
Even after13caac7, we still have more files incorrect permission, since we use "cp -r" and creating new file with redirect. To fix this, we need to replace "cp -r" with "cp -pr", and "chmod <perm>" on newly created files. Fixes #14383 Related #19775 (cherry picked from commit9d7fed40b5) Closes scylladb/scylladb#20433
This commit is contained in:
committed by
Botond Dénes
parent
6fdb124914
commit
46458226bb
29
install.sh
29
install.sh
@@ -349,6 +349,7 @@ if ! $without_systemd; then
|
||||
ExecStart=
|
||||
ExecStart=$prefix/kernel_conf/scylla_tune_sched
|
||||
EOS
|
||||
chmod 644 "$retc"/systemd/system/scylla-tune-sched.service.d/execpath.conf
|
||||
fi
|
||||
fi
|
||||
relocate_python3 "$rprefix"/kernel_conf dist/common/kernel_conf/scylla_tune_sched
|
||||
@@ -375,6 +376,7 @@ if ! $nonroot && ! $without_systemd; then
|
||||
EnvironmentFile=
|
||||
EnvironmentFile=$sysconfdir/scylla-node-exporter
|
||||
EOS
|
||||
chmod 644 "$retc"/systemd/system/scylla-node-exporter.service.d/sysconfdir.conf
|
||||
fi
|
||||
elif ! $without_systemd; then
|
||||
install -d -m755 "$rsystemd"/scylla-node-exporter.service.d
|
||||
@@ -387,7 +389,7 @@ ExecStart=$rprefix/node_exporter/node_exporter $SCYLLA_NODE_EXPORTER_ARGS
|
||||
User=
|
||||
Group=
|
||||
EOS
|
||||
|
||||
chmod 644 "$rsystemd"/scylla-node-exporter.service.d/nonroot.conf
|
||||
fi
|
||||
|
||||
# scylla-server
|
||||
@@ -436,14 +438,13 @@ install -m755 -d "$rdata"/hints
|
||||
install -m755 -d "$rdata"/view_hints
|
||||
install -m755 -d "$rdata"/coredump
|
||||
install -m755 -d "$rprefix"/swagger-ui
|
||||
cp -r swagger-ui/dist "$rprefix"/swagger-ui
|
||||
cp -pr swagger-ui/dist "$rprefix"/swagger-ui
|
||||
install -d -m755 -d "$rprefix"/api
|
||||
cp -r api/api-doc "$rprefix"/api
|
||||
cp -pr api/api-doc "$rprefix"/api
|
||||
install -d -m755 -d "$rprefix"/scyllatop
|
||||
cp -r tools/scyllatop/* "$rprefix"/scyllatop
|
||||
cp -pr tools/scyllatop/* "$rprefix"/scyllatop
|
||||
install -d -m755 -d "$rprefix"/scripts
|
||||
cp -r dist/common/scripts/* "$rprefix"/scripts
|
||||
chmod 755 "$rprefix"/scripts/*
|
||||
cp -pr dist/common/scripts/* "$rprefix"/scripts
|
||||
ln -srf "$rprefix/scyllatop/scyllatop.py" "$rprefix/bin/scyllatop"
|
||||
if $supervisor; then
|
||||
install -d -m755 "$rprefix"/supervisor
|
||||
@@ -461,6 +462,7 @@ SBINFILES+=" $(cd seastar/scripts; ls seastar-cpu-map.sh)"
|
||||
cat << EOS > "$rprefix"/scripts/scylla_product.py
|
||||
PRODUCT="$product"
|
||||
EOS
|
||||
chmod 644 "$rprefix"/scripts/scylla_product.py
|
||||
|
||||
if ! $nonroot && ! $without_systemd; then
|
||||
install -d -m755 "$retc"/systemd/system/scylla-server.service.d
|
||||
@@ -472,6 +474,7 @@ EnvironmentFile=
|
||||
EnvironmentFile=$sysconfdir/scylla-server
|
||||
EnvironmentFile=/etc/scylla.d/*.conf
|
||||
EOS
|
||||
chmod 644 "$retc"/systemd/system/scylla-server.service.d/sysconfdir.conf
|
||||
for i in daily restart; do
|
||||
install -d -m755 "$retc"/systemd/system/scylla-housekeeping-$i.service.d
|
||||
cat << EOS > "$retc"/systemd/system/scylla-housekeeping-$i.service.d/sysconfdir.conf
|
||||
@@ -496,6 +499,7 @@ ExecStopPost=
|
||||
User=
|
||||
AmbientCapabilities=
|
||||
EOS
|
||||
chmod 644 "$rsystemd"/scylla-server.service.d/nonroot.conf
|
||||
else
|
||||
cat << EOS > "$rsystemd"/scylla-server.service.d/nonroot.conf
|
||||
[Service]
|
||||
@@ -514,6 +518,7 @@ StandardOutput=file:$rprefix/scylla-server.log
|
||||
StandardError=
|
||||
StandardError=inherit
|
||||
EOS
|
||||
chmod 644 "$rsystemd"/scylla-server.service.d/nonroot.conf
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -523,6 +528,7 @@ if ! $nonroot; then
|
||||
cat << EOS > "$rprefix"/scripts/scylla_sysconfdir.py
|
||||
SYSCONFDIR="$sysconfdir"
|
||||
EOS
|
||||
chmod 644 "$rprefix"/scripts/scylla_sysconfdir.py
|
||||
fi
|
||||
install -m755 -d "$rusr/bin"
|
||||
install -m755 -d "$rhkdata"
|
||||
@@ -530,7 +536,7 @@ EOS
|
||||
ln -srf "$rprefix/bin/iotune" "$rusr/bin/iotune"
|
||||
ln -srf "$rprefix/bin/scyllatop" "$rusr/bin/scyllatop"
|
||||
ln -srf "$rprefix/bin/nodetool" "$rusr/bin/nodetool"
|
||||
install -d "$rusr"/sbin
|
||||
install -d -m755 "$rusr"/sbin
|
||||
for i in $SBINFILES; do
|
||||
ln -srf "$rprefix/scripts/$i" "$rusr/sbin/$i"
|
||||
done
|
||||
@@ -553,7 +559,8 @@ else
|
||||
cat << EOS > "$rprefix"/scripts/scylla_sysconfdir.py
|
||||
SYSCONFDIR="$sysconfdir"
|
||||
EOS
|
||||
install -d "$rprefix"/sbin
|
||||
chmod 644 "$rprefix"/scripts/scylla_sysconfdir.py
|
||||
install -d -m755 "$rprefix"/sbin
|
||||
for i in $SBINFILES; do
|
||||
ln -srf "$rprefix/scripts/$i" "$rprefix/sbin/$i"
|
||||
done
|
||||
@@ -586,10 +593,12 @@ if $supervisor; then
|
||||
directory=$rprefix
|
||||
command=/bin/bash -c './supervisor/$service.sh'
|
||||
EOS
|
||||
chmod 644 `supervisor_conf $retc $service`
|
||||
if [ "$service" != "scylla-server" ]; then
|
||||
cat << EOS >> `supervisor_conf $retc $service`
|
||||
user=scylla
|
||||
EOS
|
||||
chmod 644 `supervisor_conf $retc $service`
|
||||
fi
|
||||
if $supervisor_log_to_stdout; then
|
||||
cat << EOS >> `supervisor_conf $retc $service`
|
||||
@@ -598,6 +607,7 @@ stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
EOS
|
||||
chmod 644 `supervisor_conf $retc $service`
|
||||
fi
|
||||
done
|
||||
fi
|
||||
@@ -611,7 +621,9 @@ if $nonroot; then
|
||||
fi
|
||||
# nonroot install is also 'offline install'
|
||||
touch $rprefix/SCYLLA-OFFLINE-FILE
|
||||
chmod 644 $rprefix/SCYLLA-OFFLINE-FILE
|
||||
touch $rprefix/SCYLLA-NONROOT-FILE
|
||||
chmod 644 $rprefix/SCYLLA-NONROOT-FILE
|
||||
if ! $without_systemd_check && check_usermode_support; then
|
||||
systemctl --user daemon-reload
|
||||
fi
|
||||
@@ -622,6 +634,7 @@ elif ! $packaging; then
|
||||
fi
|
||||
# run install.sh without --packaging is 'offline install'
|
||||
touch $rprefix/SCYLLA-OFFLINE-FILE
|
||||
chmod 644 $rprefix/SCYLLA-OFFLINE-FILE
|
||||
nousr=
|
||||
nogrp=
|
||||
getent passwd scylla || nousr=1
|
||||
|
||||
Reference in New Issue
Block a user