docker-systemctl-replacement icon indicating copy to clipboard operation
docker-systemctl-replacement copied to clipboard

Hi MySql services can't start

Open zfk513 opened this issue 6 years ago • 6 comments

i am using a WSL and CentOS, you know ,systemctl failed ,one answer refer me to here,the script can list , but no of the services can work , for instance ,my sql 5.7 image

zfk513 avatar Nov 06 '19 00:11 zfk513

@zfk513 you need to create the directory at /var/run/mysqld and then give the permissions as below chown mysql:mysql /var/run/mysql

Also, you would have to do it every time you restart the LxssManager service or reboot the machine.

parveenhooda avatar Nov 07 '19 08:11 parveenhooda

image

This is happening because /var/run is a volatile directory and somehow it is not able to find/create mysqld.pid file in /var/run/mysqld and hence it is failing. if it still doesn't work look for the logs at /var/logs/mysqld.log.

image

parveenhooda avatar Nov 07 '19 09:11 parveenhooda

Is it expecting that the directory gets created by the service-manager?

Please include "systemctl cat mysqld" and show the logs for "systemctl start mysqld -vvvv"

My own tests did include a lamp-stack with mariadb instead of mysqldb

https://github.com/gdraheim/docker-systemctl-images/blob/master/centos-lamp-stack.dockerfile

gdraheim avatar Nov 11 '19 07:11 gdraheim

Here are the results

systemctl cat mysqld: image

systemctl start mysqld -vvv: image

parveenhooda avatar Nov 11 '19 07:11 parveenhooda

It seems that systemctl.py has done its share, so one would need to inspect the mysql log what it was missing. I wonder why mysqld_pre_systemd needs to be run as root - surely systemctl.py does not implement PremissionsStartOnly=true. (another peculiar feature of systemd I guess).

gdraheim avatar Mar 25 '20 16:03 gdraheim

By the way, PermissionsStartOnly is deprecated.

systemd/systemd#10802:

gdraheim avatar Apr 11 '20 23:04 gdraheim