mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
MDEV-31331: Fix cut'n'paste variable name in Debian pre-inst script
There is unwanted cut'n'paste variable name in Debian pre-inst script which causes: df: '': No such file or directory /var/lib/dpkg/tmp.ci/preinst: line 215: [: : integer expression expected Rename variable to correct one and make check that that directory or symlink really exists. If it does not then fail with error and message.
This commit is contained in:
parent
a6c0a27696
commit
30fb72ca6e
1 changed files with 16 additions and 7 deletions
23
debian/mariadb-server-10.6.preinst
vendored
23
debian/mariadb-server-10.6.preinst
vendored
|
@ -224,14 +224,23 @@ then
|
|||
mkdir -Z $mysql_datadir
|
||||
fi
|
||||
|
||||
# As preset blocksize of GNU df is 1024 then available bytes is $df_available_blocks * 1024
|
||||
# 4096 blocks is then lower than 4 MB
|
||||
df_available_blocks="$(LC_ALL=C BLOCKSIZE='' df --output=avail "$mysql_datadir" | tail -n 1)"
|
||||
if [ "$df_available_blocks" -lt "4096" ]
|
||||
# Check if MariaDB datadir is available if not fails.
|
||||
# There should be symlink or directory available or something will fail.
|
||||
if [ -d "$mysql_datadir" ] || [ -L "$mysql_datadir" ]
|
||||
then
|
||||
echo "ERROR: There's not enough space in $mysql_datadir/" 1>&2
|
||||
db_stop
|
||||
exit 1
|
||||
# As preset blocksize of GNU df is 1024 then available bytes is $df_available_blocks * 1024
|
||||
# 4096 blocks is then lower than 4 MB
|
||||
df_available_blocks="$(LC_ALL=C BLOCKSIZE='' df --output=avail "$mysql_datadir" | tail -n 1)"
|
||||
if [ "$df_available_blocks" -lt "4096" ]
|
||||
then
|
||||
echo "ERROR: There's not enough space in $mysql_datadir/" 1>&2
|
||||
db_stop
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "ERROR: There's no directory or symlink available: $mysql_datadir/" 1>&2
|
||||
db_stop
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Since the home directory was created before putting the user into
|
||||
|
|
Loading…
Reference in a new issue