[MDEV-19170] Systemd not working the same as with 10.3.13 Created: 2019-04-04 Updated: 2019-05-03 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Configuration |
| Affects Version/s: | 10.3.14 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Jack Palmadesso | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | systemd | ||
| Environment: |
CENTOS 7.6 Kernel: 3.10.0-957.10.1.el7.x86_64 |
||
| Description |
|
We use our own Internal LDAP infrastructure to manage applications users. The mysql user is in LDAP but not local on any db server. In the previous version (10.3.13) I had this working in the mariadb.service unit file:
Items in bold above were added so that the mariadb service would not start until the ldap service (nslcd.service) was up and running. This worked until the other day when I upgraded a few machines to 10.3.14. Since then this no longer works. The mariadb.service tries to start and fails because it cannot find the mysql user. Workaround is to add a local user on the affected system. I've compared the unit files from 10.3.13 and 103.14 and they are identical except for the Description field which should not matter. |
| Comments |
| Comment by Elena Stepanova [ 2019-04-06 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
serg, | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2019-04-09 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
Only difference in service file is the version number:
To make a change to the systemd file like you have (from https://mariadb.com/kb/en/library/systemd/) create /etc/systemd/system/mariadb.service.d/nslcd.conf
And then run `systemctl daemon-reload`. Then it can have an effect without overriding the distro version. For the failing case what does: `systemd-analyze critical-chain mariadb.service` show? Could it be nslcd.service claiming it is started to systemd but not responding to requests? What does `journalctl -u nslcd.service`/ `systemctl status nslcd.service` show? and for comparison, what does `journalctl -u mariadb.service` / `systemctl status mariadb.service` show? | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2019-04-09 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
elenst, yes, it can | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jack Palmadesso [ 2019-04-09 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
DEV-DCV-Database usorla7vd0115x (~)-92> systemd-analyze critical-chain mariadb.service Journal entry after reboot: | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2019-04-10 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
I thought the 101ms for nslcd.service looked quite quick.
Looking at the source for the 0.8.13 code upstream here is where the pid is created, a few lines after it has daemonised and the socket is started a few lines of code later. The systemd behaviour for type=forking says ' The parent process is expected to exit when start-up is complete and all communication channels are set up'. With nslcd this isn't the case. systemd could legitimately start the mariadb service before the socket is listening creating the failure you have observed. Even later version of nslcd create the socket after forking. Suggest for the nslcd.service change Type=oneshot, and append and ExecStart= some script that waits for the socket to listen. I'm not sure why this manifested during the 10.3.14 upgrade for you however it looks like the nslcd service file isn't correct for the behaviour nslcd exhibits. | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jack Palmadesso [ 2019-04-10 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thanks, working on it. For reference here are the versions of software involved. I've confirmed that with the previous version (10.3.13) it works as expected. Versions of systemd, nss-pam-ldap are identical. Only difference is the version of the DB software. Distribution .................. CentOS 7.6.1810 MariaDB-client-10.3.14-1.el7.centos.x86_64 nss-pam-ldapd-0.8.13-16.el7.x86_64 systemd-python-219-62.el7_6.5.x86_64 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2019-04-10 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
I don't think you or Daniel need to look into it in details, it's quite probably a server bug in 10.3.14, which will be fixed in 10.3.15. | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2019-05-03 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
Now it looks like I was wrong and it's not a server bug. Back to square one... |