Skip to content

Commit fcfd636

Browse files
ottokvuvova
authored andcommitted
Deb: Fix blocksize check to use $mysql_datadir/$datadir correctly
In commit f99a891 this line was changed to not use awk, and new version copied both to init file and preinst file but overlooking that they use different variable names. Also fix minor syntax issues to make Shellcheck happy. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.
1 parent cf37e44 commit fcfd636

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

debian/mariadb-server-10.6.mariadb.init

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ sanity_checks() {
8686
datadir=`mariadbd_get_param datadir`
8787
# As preset blocksize of GNU df is 1024 then available bytes is $df_available_blocks * 1024
8888
# 4096 blocks is then lower than 4 MB
89-
df_available_blocks=`LC_ALL=C BLOCKSIZE= df --output=avail "$datadir" | tail -n 1`
89+
df_available_blocks="$(LC_ALL=C BLOCKSIZE='' df --output=avail "$datadir" | tail -n 1)"
9090
if [ "$df_available_blocks" -lt "4096" ]; then
9191
log_failure_msg "$0: ERROR: The partition with $datadir is too full!"
9292
echo "ERROR: The partition with $datadir is too full!" | $ERR_LOGGER

debian/mariadb-server-10.6.preinst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ fi
211211

212212
# As preset blocksize of GNU df is 1024 then available bytes is $df_available_blocks * 1024
213213
# 4096 blocks is then lower than 4 MB
214-
df_available_blocks=`LC_ALL=C BLOCKSIZE= df --output=avail "$datadir" | tail -n 1`
214+
df_available_blocks="$(LC_ALL=C BLOCKSIZE='' df --output=avail "$mysql_datadir" | tail -n 1)"
215215
if [ "$df_available_blocks" -lt "4096" ]; then
216216
echo "ERROR: There's not enough space in $mysql_datadir/" 1>&2
217217
db_stop

0 commit comments

Comments
 (0)