[MDEV-24130] Cannot launch mariadbd via mysqld_safe Created: 2020-11-04  Updated: 2020-11-11  Resolved: 2020-11-10

Status: Closed
Project: MariaDB Server
Component/s: Scripts & Clients
Fix Version/s: 10.3.28, 10.4.18, 10.5.9

Type: Task Priority: Major
Reporter: Tomohiro KATO Assignee: Anel Husakovic
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Duplicate
is duplicated by MDEV-24133 Using malloc-lib=jemalloc in MariaDB ... Closed
Relates
relates to MDEV-16676 Using malloc-lib=jemalloc in MariaDB ... Closed

 Description   

https://github.com/MariaDB/server/commit/95bb3cb886cb64be3ee5ace660bb78618dd4c1d0

A function "my_which" is not implemented in mysqld_safe of mariadb-10.5.



 Comments   
Comment by Daniel Black [ 2020-11-04 ]

Apologies. Does changing "my_which" -> "which" work correctly?

Comment by Tomohiro KATO [ 2020-11-04 ]

Yes. I changed "my_which" to "which". Then mysqld_safe worked as expected.

Thanks.

Comment by Anel Husakovic [ 2020-11-05 ]

danblack we can change my_which to which (solution 1)but there are other usecases in mysql_safe which are using my_which where additional check of IFS variable used and I'm planning to stick to this (so no solution 1).
The problem here is with PATH variable which cannot locate ldconfig.
So in addition we can export PATH=$PATH:/sbin after the first failure and again call my_which (solution 2)?
tomop which OS you are using and what will happen if you add /sbin to your PATH without changing my_which->which?

Comment by Tomohiro KATO [ 2020-11-05 ]

tomop which OS you are using and what will happen if you add /sbin to your PATH without changing my_which->which?

I'm using Vine Linux and MariaDB-10.5.7.

# env | grep PATH
PATH=/root/perl5/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# /etc/init.d/mysql start
Starting MariaDB.201105 23:08:41 mysqld_safe ldconfig command not found, required for ldconfig -p

"my_which" does not exist after 10.2. It shouldn't work.

Comment by Anel Husakovic [ 2020-11-05 ]

So what is the output of which ldconfig ?

Comment by Anel Husakovic [ 2020-11-05 ]

Oh I was looking into 10.2

Comment by Anel Husakovic [ 2020-11-05 ]

So based on patch 355ee6877bec we should change it to command -v from 10.3+.

Comment by Anel Husakovic [ 2020-11-05 ]

danblack please review patch

Comment by Tomohiro KATO [ 2020-11-05 ]

I applied the patch and mysqld_safe worked properly.

Thanks.

Comment by Daniel Black [ 2020-11-06 ]

Looks good to me. I've pushed to a bb branch bb-10.3-anel-MDEV-24130 just to be sure it doesn't trip on anything.

$ scripts/mysqld_safe --malloc-lib=jemalloc
201106 15:36:13 mysqld_safe Adding '/lib64/libjemalloc.so.2' to LD_PRELOAD for mysqld
201106 15:36:13 mysqld_safe Logging to '/usr/local/mysql/data/linux.fritz.box.err'.
201106 15:36:13 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
 
$ grep jemalloc /proc/186109/maps 
7fab34a13000-7fab34a19000 r--p 00000000 fd:01 1846215                    /usr/lib64/libjemalloc.so.2
7fab34a19000-7fab34a8d000 r-xp 00006000 fd:01 1846215                    /usr/lib64/libjemalloc.so.2
7fab34a8d000-7fab34a9b000 r--p 0007a000 fd:01 1846215                    /usr/lib64/libjemalloc.so.2
7fab34a9b000-7fab34aa1000 r--p 00087000 fd:01 1846215                    /usr/lib64/libjemalloc.so.2
7fab34aa1000-7fab34aa2000 rw-p 0008d000 fd:01 1846215                    /usr/lib64/libjemalloc.so.2

Merge after seeing bb passing with no failures attributable to this change.

Comment by Anel Husakovic [ 2020-11-10 ]

Reviewed by danblack (missing information in commit message, sorry).
Closed with 3bf726f5ffc568b15e9788ed for 10.3
Thanks for the review Daniel.

Generated at Thu Feb 08 09:27:40 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.