Bug 894750
Summary: | MySQL does not start if /var/run/mysqld/ is missing | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Dr. Tilmann Bubeck <tilmann> |
Component: | systemd | Assignee: | systemd-maint |
Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 18 | CC: | hhorak, johannbg, lnykryn, metherid, msekleta, notting, plautrba, systemd-maint, tgl, vpavlin |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2013-01-13 21:11:14 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Dr. Tilmann Bubeck
2013-01-13 17:00:00 UTC
If true, this would mean that something is broken in systemd's tmpfiles support, because mysql-server does install a file /usr/lib/tmpfiles.d/mysql.conf containing d /var/run/mysqld 0755 mysql mysql - So if that directory isn't there after a reboot, it's not mysql's fault. I wonder whether bug #894590 is related ... Thanks for pointing to /usr/lib/tmpfiles.d, this gives more information: 1. I am running NIS with the mysql user coming from NIS (I was not aware of this). 2. In mysql-server's preinstall scriptlet, the user "mysql" is useradded which does nothing in my case, because that user is already known to the system (from NIS). 3. Upon poweron, NIS is not already loaded, so the user mysql is unknown to /usr/lib/tmpfiles.d/mysql.conf which gives the following error to journald: Jan 13 21:09:20 frodo.wid.reinform.de systemd-tmpfiles[513]: [/usr/lib/tmpfiles.d/mysql.conf:1] Unknown user 'mysql'. 4. Therefore, the directory is not created and the problem arises. Proposal 1: I see mysql as a local user which should not come from NIS. Therefore I delete it from NIS and anything should work. The problem could be seen by executing "systemctl --failed" which shows that systemd-tmpfiles-setup.service failed. However, because of plymouth I was not aware, that anything was failing at all. Proposal 2: Invent anything, which shows clearly upon poweron, that something failed, which is otherwise hidden by plymouth. Maybe a information sign in GDM telling "Attention: There are failed services. Please use systemctl --failed to list them"... Or something else. (In reply to comment #2) > 1. I am running NIS with the mysql user coming from NIS (I was not aware of > this). > > 2. In mysql-server's preinstall scriptlet, the user "mysql" is useradded > which does nothing in my case, because that user is already known to the > system (from NIS). > > 3. Upon poweron, NIS is not already loaded, so the user mysql is unknown > to /usr/lib/tmpfiles.d/mysql.conf which gives the following error to > journald: > Jan 13 21:09:20 frodo.wid.reinform.de systemd-tmpfiles[513]: > [/usr/lib/tmpfiles.d/mysql.conf:1] Unknown user 'mysql'. Wow, that's an interesting failure mode. It seems unlikely that we'd want to try to make NIS start before systemd-tmpfiles runs. So that means that all usernames mentioned in tmpfiles scripts had better be locally known. How can that be implemented/enforced? Or maybe there had better be some sort of caching of those names, rather than restricting the functionality? You cannot have system users in LDAP really. This will fail here and a ton of other areas. It's fine to share actual human users with LDAP, but if you share system users you must make them available even if the network is connectable. There are solutions for that (i think sssd can cache that for you), but as system users are generally managed by postinst scripts, and hence are more under the ownership of the OS than the admin I'd not bother. Really, I don't see anything to fix there. This is not a supported setup, and hence you keep the parts. You get an error message, like you would get for other issues to. Closing. (In reply to comment #4) > You cannot have system users in LDAP really. That seems reasonable ... > Really, I don't see anything to fix there. ... but I'm concerned about how Till managed to get system users into NIS without knowing it. Seems like there might be at least a usability problem. Maybe it's not systemd's fault, but some component didn't do a good job here. As far as mysql in particular is concerned, it seems like it would have been a good thing to force the mysql user to be created locally, whether or not it was known in NIS. Is there a way to tell useradd to do that? (In reply to comment #5) > (In reply to comment #4) > > You cannot have system users in LDAP really. > > That seems reasonable ... > > > Really, I don't see anything to fix there. > > ... but I'm concerned about how Till managed to get system users into NIS > without knowing it. Seems like there might be at least a usability problem. > Maybe it's not systemd's fault, but some component didn't do a good job here. Hmm, does useradd(8) actually have support for creating users via LDAP? If so, it should refuse to do that if --system is specified. Might be worth filing a bug about that. > > As far as mysql in particular is concerned, it seems like it would have been > a good thing to force the mysql user to be created locally, whether or not > it was known in NIS. Is there a way to tell useradd to do that? Probably something to ask in the bug to file. But honestly "--system" should be enough of an indication for that I think (In reply to comment #6) > Hmm, does useradd(8) actually have support for creating users via LDAP? More the reverse, actually. man useradd quoth: You may not add a user to a NIS or LDAP group. This must be performed on the corresponding server. Similarly, if the username already exists in an external user database such as NIS or LDAP, useradd will deny the user account creation request. mysql.spec ignores failure of the useradd command (and there's not much it could do about it anyway AFAICS). So the failure mode was that Till transferred his whole /etc/passwd list into NIS, probably from some previous incarnation of his system, and then mysql.spec failed to recreate the local mysql user on this machine. I can see the point of the useradd restriction, ie not to let local and remote user databases have conflicting entries, but it's not being helpful in this case. I'll file a bug, though I suspect there may not be any very nice answer here. shadow-utils bug filed at bug #895765 @Lennart: Yes, it was my fault, to create the mysql user in NIS. But the proposal I was giving in comment #2 was: Proposal 2: Invent anything, which shows clearly upon poweron, that a service failed, which is otherwise hidden by plymouth. Maybe a information sign in GDM telling "Attention: There are failed services. Please use systemctl --failed to list them"... Or something else. Do you think, this would be helpful for users with problems in their configuration? Are you willing to support it? Till, on systemd's todo list is to turn of boot time logging automatically on the first failing service. Next step would then be to tell Plymouth to terminate too. Added that bit to the todo list now, too |