[MDEV-25177] Better indication of refusing to start because of ProtectHome Created: 2021-03-17 Updated: 2023-09-19 Resolved: 2023-09-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Server |
| Affects Version/s: | 10.5.9 |
| Fix Version/s: | 10.4.32, 10.5.23, 10.6.16, 10.10.7, 10.11.6, 11.0.4, 11.1.3, 11.2.2 |
| Type: | Bug | Priority: | Major |
| Reporter: | Premek | Assignee: | Daniel Black |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
debian |
||
| Issue Links: |
|
||||||||||||
| Description |
|
I just spent unreasonable amount of time until I learnt about existence of the `ProtectHome` setting. My use case is I needed to change the directory to home because I don't have space anywhere else on my dev environment (which I think could be common) I believe when mariadb refuses to start because ProtectHome=true it is not logged/displayed, not obvious to someone who doesn't know about this setting. Please ignore/close the issue if this is not true and I just didn't see it |
| Comments |
| Comment by Tuukka Pasanen [ 2021-08-23 ] | |||||||||||||||||||||||||||||||||||||||||
|
This seems to be mostly same than | |||||||||||||||||||||||||||||||||||||||||
| Comment by Tuukka Pasanen [ 2021-09-12 ] | |||||||||||||||||||||||||||||||||||||||||
|
There is now Pull request against this bug | |||||||||||||||||||||||||||||||||||||||||
| Comment by Otto Kekäläinen [ 2021-09-14 ] | |||||||||||||||||||||||||||||||||||||||||
|
i dived into this a bit deeper. If you move your /var/lib/mysql under /home (as the bug reporter here indicates they did, though exact paths are not in the bug report), MariaDB fill quite clearly stop starting and there is an error message immediately visible:
Indeed, it does not say why it can't write into the datadir /var/lib/mysql. ..and it seems that the root cause isn't ProtectedHome, as setting it to `no` does not fix the issue:
| |||||||||||||||||||||||||||||||||||||||||
| Comment by Tuukka Pasanen [ 2021-09-14 ] | |||||||||||||||||||||||||||||||||||||||||
|
I expect chmod and chown are correct? I love how systemd just puts [92B blob data] when it expects it's binary data. Would it be more verbose on start if chmod/chown is incorrect way to handle this... | |||||||||||||||||||||||||||||||||||||||||
| Comment by Otto Kekäläinen [ 2021-09-14 ] | |||||||||||||||||||||||||||||||||||||||||
|
Yes, chmod and chown are correct (actually unchanged as I used 'cp -a' to Your can do the same test yourself and see if you get different results. Indeed, systemd is not very helpful here. Maybe file an issue upstream at | |||||||||||||||||||||||||||||||||||||||||
| Comment by Premek [ 2021-09-14 ] | |||||||||||||||||||||||||||||||||||||||||
|
Hi, thanks for looking into this. Sorry I don't remember exactly what my error message was, but I configured it using
not a symlink | |||||||||||||||||||||||||||||||||||||||||
| Comment by Tuukka Pasanen [ 2021-12-03 ] | |||||||||||||||||||||||||||||||||||||||||
|
premek Ok then Pull Request shell script should give enough information. Can you give feedback is it working? You can find script from PR. | |||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2022-01-31 ] | |||||||||||||||||||||||||||||||||||||||||
|
the environment systemd provides in ExecStartPre isn't as hardened as ExecStart so some of the more practical tests need re-examining. | |||||||||||||||||||||||||||||||||||||||||
| Comment by Premek [ 2022-01-31 ] | |||||||||||||||||||||||||||||||||||||||||
|
Hi, thank you for looking into my issue, but I'm currently not able to test the fix, sorry | |||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2022-02-15 ] | |||||||||||||||||||||||||||||||||||||||||
|
In the testing of the PR:
As datadir is the likely variable to hit this restriction, an errno=13 + systemd could result in a more verbose warning hint in the server in test_if_case_insensitive. secure_file_priv seems the other variable likely to be changed to a home/system location can could get the same error checks. premek (or anyone watching) can you think of any other variables require special testing/error handing? | |||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2023-08-30 ] | |||||||||||||||||||||||||||||||||||||||||
|
Acceptable? https://github.com/MariaDB/server/pull/2743 |