0

I see this strange behavior when Mariadb is run on RHEL7 and RHEL6.

When I start the mariadb server on RHEL6 via service mysql start, I see mysqld_safe starts along with mysqld.

[user@divinedragon]# service mysql start
Starting mysql (via systemctl):                            [  OK  ]

[user@divinedragon]# ps aux | grep mysql
root      2398  0.0  0.0 115372  1712 ?        S    09:26   0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/divinedragon.pid
mysql     2472  2.8  3.4 798208 134576 ?       Sl   09:26   0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/divinedragon.err --pid-file=/var/lib/mysql/divinedragon.pid
root      2503  0.0  0.0 112644   956 pts/0    S+   09:27   0:00 grep --color=auto mysql

However, when I do the same thing on RHEL7, I don't see any mysqld_safe process coming up. Here is the ouput from RHEL 7.

[user@divinedragon ~]$ sudo service mysql start
Starting mysql (via systemctl):                            [  OK  ]

[user@divinedragon ~]$ ps aux | grep mysql
mysql     2515  2.6  6.0 774616 114412 ?       Ssl  08:51   0:00 /usr/sbin/mysqld
user      2548  0.0  0.0 112644   952 pts/0    R+   08:51   0:00 grep --color=auto mysql

Can somebody shed some light in here?

2
  • I imagine this is a systemd thing. Check the /usr/lib/systemd/system/mysql.service file on RHEL7, it probably does the job of mysqld_safe now.
    – dwjv
    Commented Aug 5, 2016 at 10:06
  • I got a section where it says - Options previously available to be set via [mysqld_safe] that now needs to be set by systemd config files as mysqld_safe isn't executed.. Does that mean systemd is doing the work of mysqld_safe now? Commented Aug 5, 2016 at 10:56

1 Answer 1

2

It is stated in the mariadb and even mysql docs:

https://mariadb.com/kb/en/mariadb/systemd/

systemd services are packaged on RPM and Debian based Linux distributions. When systemd is used, mysqld_safe is not used and settings in the mysqld_safe section of configuration files will not be read or applied.

https://dev.mysql.com/doc/refman/5.7/en/server-management-using-systemd.html

On platforms for which systemd support is installed, scripts such as mysqld_safe and the System V initialization script are not installed because they are unnecessary. For example, mysqld_safe can handle server restarts, but systemd provides the same capability, and does so in a manner consistent with management of other services rather than using an application-specific program.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.