Bug 1598095 - problem with fuser usage during init
Summary: problem with fuser usage during init
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: mariadb
Version: 7.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Michal Schorm
QA Contact: Anna Khaitovich
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-07-04 10:37 UTC by Karel Volný
Modified: 2019-08-06 13:18 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-06 13:18:16 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2019:2327 None None None 2019-08-06 13:18:44 UTC

Description Karel Volný 2018-07-04 10:37:59 UTC
Description of problem:
the script
/usr/libexec/mariadb-prepare-db-dir
makes use of the 'fuser' command

there are two problems with that:

a) the package doesn't depend on psmisc, so fuser command doesn't need to be installed
b) the script runs with mysql user privileges, which prevents fuser from functioning correctly

Version-Release number of selected component (if applicable):
mariadb-server-5.5.60-1.el7_5.x86_64

Comment 2 Honza Horak 2018-07-04 10:51:01 UTC
We probably should use a similar check as we're doing in Fedora:

  # some process uses the socket file
  response=`@bindir@/mysqladmin --no-defaults --socket="$socketfile" --user=UNKNOWN_MYSQL_USER --connect-timeout="${CHECKSOCKETTIMEOUT:-10}" ping 2>&1`
  if [ $? -qe 0 ] || echo "$response" | grep -q "Access denied for user" ; then
    echo "Is another MySQL daemon already running with the same unix socket?" >&2
    echo "Please, stop the process using the socket $socketfile or remove the file manually to start the service." >&2
    exit 1
  fi

Taken from https://src.fedoraproject.org/cgit/rpms/mariadb.git/tree/mysql-check-socket.sh#n28

Comment 9 Anna Khaitovich 2019-06-10 07:55:00 UTC
OLD:
$ rpm -qa mariadb-server
mariadb-server-5.5.60-1.el7_5.x86_64
$ grep fuser /usr/libexec/mariadb-prepare-db-dir
if fuser "$socketfile" &>/dev/null ; then

NEW:
$ rpm -qa mariadb-server
mariadb-server-5.5.64-1.el7.x86_64
$ grep fuser /usr/libexec/mariadb-prepare-db-dir
$ echo $?
1

old FAIL. new PASS => FIXED

Comment 11 errata-xmlrpc 2019-08-06 13:18:16 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2019:2327


Note You need to log in before you can comment on or make changes to this bug.