Bug 1691288

Summary: mysqld_safe --dry-run doesn't work as expected [rhscl-3.6.0]
Product: Red Hat Software Collections Reporter: Michal Schorm <mschorm>
Component: mariadbAssignee: Michal Schorm <mschorm>
Status: CLOSED ERRATA QA Contact: Lukáš Zachar <lzachar>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rh-mariadb103CC: bmikulov, databases-maint, kvolny, mmuzila
Target Milestone: alphaKeywords: ZStream
Target Release: 3.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1689300
: 1894105 (view as bug list) Environment:
Last Closed: 2020-12-02 22:42:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1834889, 1894105, 1894122    

Description Michal Schorm 2019-03-21 11:02:14 UTC
+++ This bug was initially created as a clone of Bug #1689300 +++

Description of problem:
mysqld_safe --dry-run doesn't work as expected

Version-Release number of selected component (if applicable):
mariadb-server-10.3.11-1.module+el8+2765+cfa4f87b

How reproducible:
always

Steps to Reproduce:
1. dnf install -y mariadb-server
2. systemctl start mariadb
3. systemctl stop mariadb
4. mysqld_safe --dry-run

Actual results:
[root@host-8-250-109 ~]# mysqld_safe --dry-run
/usr/bin/mysqld_safe: line 932: return: can only `return' from a function or sourced script
^C^C^C^C^C^Z
[1]+  Stopped                 mysqld_safe --dry-run
[root@host-8-250-109 ~]# ps -ef | grep mysql
root      7196  6107  0 11:52 pts/0    00:00:00 /bin/sh /usr/bin/mysqld_safe --dry-run
mysql     7280  7196  0 11:52 pts/0    00:00:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mariadb/plugin --user=mysql --log-error=/var/log/mariadb/mariadb.log --pid-file=/run/mariadb/mariadb.pid --socket=/var/lib/mysql/mysql.sock


Expected results:
it returns to shell without mysqld running

Additional info:
# mysqld_safe --help | grep dry
  --dry-run                  Simulate the start to detect errors but don't start

--- Additional comment from Michal Schorm on 2019-03-21 10:43:42 UTC ---

Fix deployed for Fedora:
https://src.fedoraproject.org/rpms/mariadb/c/fe4891c5b8e6e5f0ce35328e3fa7b9e6efbb2644?branch=master

Comment 6 Michal Schorm 2020-07-14 06:36:57 UTC
MAINTAINER NOTE:

I reached upstream with this issue.
The script was never meant to be called by an user, instead, that particual part of script was intended to be ran by other scripts.

The upstream solved the issue in:
  MariaDB 10.1.42
  MariaDB 10.2.28
  MariaDB 10.3.19
with:
  https://github.com/MariaDB/server/commit/6a7d51b1cb

---

I removed the internally prepared patch in favor of the upstream fix.

Comment 9 Barbora Mikulova 2020-11-03 14:53:30 UTC
z-stream clone for rhscl-3.5 created: Bug#1894105

Comment 10 Michal Schorm 2020-12-02 22:42:36 UTC
Errata for RHSCL 3.5.z has been released.
RHBA-2020:5318