mdbx-test: не вызываем sudo при отсутствии.

This commit is contained in:
Леонид Юрьев (Leonid Yuriev) 2022-10-13 17:56:42 +03:00
parent 6c986ce904
commit c4beb5a4a0
2 changed files with 10 additions and 2 deletions

View File

@ -275,7 +275,11 @@ case ${UNAME} in
ulimit -c unlimited
if [ "$(cat /proc/sys/kernel/core_pattern)" != "core.%p" ]; then
echo "core.%p > /proc/sys/kernel/core_pattern" >&2
echo "core.%p" | sudo tee /proc/sys/kernel/core_pattern || true
if [ $(id -u) -ne 0 -a -n "$(which sudo 2>/dev/null)" ]; then
echo "core.%p" | sudo tee /proc/sys/kernel/core_pattern || true
else
(echo "core.%p" > /proc/sys/kernel/core_pattern) || true
fi
fi
;;

View File

@ -213,7 +213,11 @@ case ${UNAME} in
ulimit -c unlimited
if [ "$(cat /proc/sys/kernel/core_pattern)" != "core.%p" ]; then
echo "core.%p > /proc/sys/kernel/core_pattern" >&2
echo "core.%p" | sudo tee /proc/sys/kernel/core_pattern || true
if [ $(id -u) -ne 0 -a -n "$(which sudo 2>/dev/null)" ]; then
echo "core.%p" | sudo tee /proc/sys/kernel/core_pattern || true
else
(echo "core.%p" > /proc/sys/kernel/core_pattern) || true
fi
fi
;;