Skip to content

Commit

Permalink
Deb: Fix blocksize check to use $mysql_datadir/$datadir correctly
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ottok authored and vuvova committed Jun 3, 2023
1 parent cf37e44 commit fcfd636
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion debian/mariadb-server-10.6.mariadb.init
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ sanity_checks() {
datadir=`mariadbd_get_param datadir`
# 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 "$datadir" | tail -n 1`
df_available_blocks="$(LC_ALL=C BLOCKSIZE='' df --output=avail "$datadir" | tail -n 1)"
if [ "$df_available_blocks" -lt "4096" ]; then
log_failure_msg "$0: ERROR: The partition with $datadir is too full!"
echo "ERROR: The partition with $datadir is too full!" | $ERR_LOGGER
Expand Down
2 changes: 1 addition & 1 deletion debian/mariadb-server-10.6.preinst
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ 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 "$datadir" | tail -n 1`
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
Expand Down

0 comments on commit fcfd636

Please sign in to comment.