Description:
Running systemctl start mysqld I get:
Nov 11 14:30:36 lxhost mysqld[2458]: 2015-11-11T13:30:36.629259Z 0 [Warning] CA certificate ca.pem is self signed.
Nov 11 14:30:36 lxhost mysqld[2458]: 2015-11-11T13:30:36.629292Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
Nov 11 14:30:36 lxhost mysqld[2458]: 2015-11-11T13:30:36.629793Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
Nov 11 14:30:36 lxhost mysqld[2458]: 2015-11-11T13:30:36.629821Z 0 [Note] IPv6 is available.
Nov 11 14:30:36 lxhost mysqld[2458]: 2015-11-11T13:30:36.629828Z 0 [Note] - '::' resolves to '::';
Nov 11 14:30:36 lxhost mysqld[2458]: 2015-11-11T13:30:36.629834Z 0 [Note] Server socket created on IP: '::'.
Nov 11 14:30:36 lxhost mysqld[2458]: 2015-11-11T13:30:36.636377Z 0 [Note] Event Scheduler: Loaded 0 events
Nov 11 14:30:36 lxhost mysqld[2458]: 2015-11-11T13:30:36.636676Z 0 [Note] /usr/x86_64-pc-linux-gnu/bin/mysqld: ready for connections.
Nov 11 14:30:36 lxhost mysqld[2458]: Version: '5.7.9' socket: '/run/mysqld/mysqld.sock' port: 3306 Exherbo
Nov 11 14:30:36 lxhost systemd[1]: mysqld.service: PID file /run/mysqld/mysqld.pid not readable (yet?) after start: No such file or directory
Having a look in the service file /usr/x86_64-pc-linux-gnu/lib/systemd/system/mysqld.service there's a line:
PIDFile=/run/mysqld/mysqld.pid
which probably is for systemd itself and not used by mysqld. After adding --pid-file=/run/mysqld/mysqld.pid to the ExecStart in the mysqld.service file:
# Start main service
ExecStart=/usr/x86_64-pc-linux-gnu/bin/mysqld --daemonize $MYSQLD_OPTS --pid-file=/run/mysqld/mysqld.pid
systemctl start mysqld is working fine:
Nov 11 14:31:48 lxhost mysqld[2536]: 2015-11-11T13:31:48.007535Z 0 [Note] /usr/x86_64-pc-linux-gnu/bin/mysqld: ready for connections.
Nov 11 14:31:48 lxhost mysqld[2536]: Version: '5.7.9' socket: '/run/mysqld/mysqld.sock' port: 3306 Exherbo
Nov 11 14:31:48 lxhost systemd[1]: Started MySQL Server.
How to repeat:
1. compile from sources
2. install
3. try to start mysql via the provided systemd service
Suggested fix:
Could you introduce a compile time option like e.g. -DMYSQL_PIDFILE:STRING=/run/mysqld/mysqld.pid to set a default for the pidfile just like it is already in place for other things like e.g. datadir (-DMYSQL_DATADIR:PATH=/var/lib/mysql)?
And/Or add --pid-file=@SYSTEMD_PID_DIR@/mysqld.pid to ExecStart in the mysqld.service.in file in the sources?