[MDEV-19798] Error on booting: mysqld_safe: The file /etc/mysql//mysqld#012does not exist or is not executable Created: 2019-06-18  Updated: 2019-07-07

Status: Open
Project: MariaDB Server
Component/s: Packaging, Platform Debian
Affects Version/s: 10.2.25
Fix Version/s: 10.2

Type: Bug Priority: Major
Reporter: Jorge Ferrando Assignee: Elena Stepanova
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Ubuntu 18.04. Mariadb 10.2.25 Galera cluster



 Description   

After upgrading the cluster from 10.1 to 10.2 we get this error when trying to restart the server:

Jun 18 08:48:34 dbmysql1 mysql[32263]:  * Starting MariaDB database server mysqld
Jun 18 08:48:34 dbmysql1 /etc/init.d/mysql[32294]: 190618 08:48:34 mysqld_safe The file /etc/mysql//mysqld
Jun 18 08:48:34 dbmysql1 /etc/init.d/mysql[32294]: does not exist or is not executable. Please cd to the mysql installation
Jun 18 08:48:34 dbmysql1 /etc/init.d/mysql[32294]: directory and restart this script from there as follows:
Jun 18 08:48:34 dbmysql1 /etc/init.d/mysql[32294]: ./bin/mysqld_safe&
Jun 18 08:48:34 dbmysql1 /etc/init.d/mysql[32294]: See https://mariadb.com/kb/en/mysqld_safe for more information
Jun 18 08:48:34 dbmysql1 mysqld_safe: The file /etc/mysql//mysqld#012does not exist or is not executable. Please cd to the mysql installation#012directory and restart this script from there as follows:#012./bin/mysqld_safe&#012See https://mariadb.com/kb/en/mysqld_safe for more information

Looking at /usr/bin/mysqld_safe looks like variable $ledir is not being properly initialized and this test is failing:

if test ! -x "$ledir/$MYSQLD"

Setting

ledir='/usr/sbin'

before that line makes it work.



 Comments   
Comment by Andrew Hutchings (Inactive) [ 2019-06-18 ]

Moved to MariaDB Server. This doesn't appear to be a ColumnStore bug.

Comment by Jorge Ferrando [ 2019-06-18 ]

Sorry. It seems I confused sites

Comment by Elena Stepanova [ 2019-07-04 ]

Do you use packages built by MariaDB, or do you build from source?
If it's packages, which ones?

Comment by Jorge Ferrando [ 2019-07-05 ]

I'm using mariadb repo.
At the moment of the problem I was using a mirror at http://tedeco.fi.upm.es/ but It's no longer available so I switched to http://mariadb.mirror.pcextreme.nl/repo/10.2/ubuntu

Comment by Elena Stepanova [ 2019-07-05 ]

Ubuntu 18.04 packages have systemd support, they shouldn't be using mysqld_safe for running the server. Do you have your own startup scripts?

Comment by Jorge Ferrando [ 2019-07-05 ]

No I don't.

I recently upgraded from 16.04 to 18.04 and also from 10.1 to 10.2 though.

May it be something left from the previous versions?

Comment by Elena Stepanova [ 2019-07-05 ]

What command do you run to restart the server?
Also, please paste the output of
dpkg -l | grep -iE 'maria|mysql'

Comment by Jorge Ferrando [ 2019-07-05 ]

service mysql stop / start
or
/etc/init.d/mysql stop / start

dpkg -l | grep -iE 'maria|mysql'
ii  libdbd-mysql-perl                     4.046-1                           amd64        Perl5 database interface to the MariaDB/MySQL database
ii  libmysqlclient20:amd64                5.7.26-0ubuntu0.18.04.1           amd64        MySQL database client library
ii  mariadb-backup-10.2                   1:10.2.25+maria~bionic            amd64        Backup tool for MariaDB server
rc  mariadb-client-10.1                   1:10.1.40+maria-1~bionic          amd64        MariaDB database client binaries
ii  mariadb-client-10.2                   1:10.2.25+maria~bionic            amd64        MariaDB database client binaries
ii  mariadb-client-core-10.2              1:10.2.25+maria~bionic            amd64        MariaDB database core client binaries
ii  mariadb-common                        1:10.2.25+maria~bionic            all          MariaDB database common files (e.g. /etc/mysql/conf.d/mariadb.cnf)
ii  mariadb-server                        1:10.2.25+maria~bionic            all          MariaDB database server (metapackage depending on the latest version)
rc  mariadb-server-10.1                   1:10.1.40+maria-1~bionic          amd64        MariaDB database server binaries
ii  mariadb-server-10.2                   1:10.2.25+maria~bionic            amd64        MariaDB database server binaries
ii  mariadb-server-core-10.2              1:10.2.25+maria~bionic            amd64        MariaDB database core server files
ii  mysql-common                          1:10.2.25+maria~bionic            all          MariaDB database common files (e.g. /etc/mysql/my.cnf)
ii  mysqltuner                            1.7.2-1                           all          high-performance MySQL tuning script
ii  percona-toolkit                       3.0.13-1.xenial                   amd64        Advanced MySQL and system command-line tools

Comment by Elena Stepanova [ 2019-07-05 ]

does it happen when you do
service mariadb start
? (You need to stop the server first if you are running, the same way you started it).

Comment by Jorge Ferrando [ 2019-07-05 ]

with the server stopped:

service mariadb start
Failed to start mariadb.service: Unit mariadb.service is not loaded properly: Invalid argument.
See system logs and 'systemctl status mariadb.service' for details.

And the log:

Jul  5 12:48:49 dbmysql1 systemd[1]: mariadb.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.

Comment by Elena Stepanova [ 2019-07-05 ]

Can you check which package mariadb.service belongs to, and attach it as a file?

Comment by Jorge Ferrando [ 2019-07-05 ]

dpkg -S mariadb.service
mariadb-server-10.2: /lib/systemd/system/mariadb.service

cat /etc/systemd/system/mariadb.service
[Service]
 
TimeoutStartSec=300

Comment by Elena Stepanova [ 2019-07-05 ]

serg, any ideas where this stub above could come from?

Comment by Sergei Golubchik [ 2019-07-07 ]

No.
May be something that ubuntu does on upgrade from non-systemd to systemd distro?

The only tool that can write [Service] in MariaDB is mariadb-service-convert script and it unconditionally writes a comment at the beginning of the service file.

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