Skip to content

Commit

Permalink
MDEV-31216: Make sure that lsof does not fail on install
Browse files Browse the repository at this point in the history
Command lsof can fail on Debian install.
Revert logic more like old one to make sure that there is no failing
and still does don't boundce on shellcheck.
  • Loading branch information
illuusio authored and grooverdan committed May 8, 2023
1 parent 50cdf0b commit 2740b65
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions debian/mariadb-server-10.6.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@ EOF
# This direct update is needed to enable an authentication mechanism to
# perform mariadb-upgrade, (MDEV-22678). To keep the impact minimal, we
# skip innodb and set key-buffer-size to 0 as it isn't reused.
lsof -nt "$mysql_datadir"/mysql/user.MYD > /dev/null
lsof_rtn_code=$?
if [ -f "$mysql_datadir/auto.cnf" ] && [ -f "$mysql_datadir/mysql/user.MYD" ] &&
[ ! ${lsof_rtn_code} ] && [ ! -f "$mysql_datadir/undo_001" ]
if [ -f "$mysql_datadir/auto.cnf" ] &&
[ -f "$mysql_datadir/mysql/user.MYD" ] &&
! lsof -nt "$mysql_datadir"/mysql/user.MYD > /dev/null &&
[ ! -f "$mysql_datadir/undo_001" ]
then
echo "UPDATE mysql.user SET plugin='unix_socket' WHERE plugin='auth_socket';" |
mariadbd --skip-innodb --key_buffer_size=0 --default-storage-engine=MyISAM --bootstrap 2> /dev/null
Expand Down

0 comments on commit 2740b65

Please sign in to comment.