Add AppArmor notice for Debian/Ubuntu users during server startup#5003
Add AppArmor notice for Debian/Ubuntu users during server startup#5003ottok wants to merge 1 commit intoMariaDB:mainfrom
Conversation
When MariaDB fails to start due to permission errors, users on Debian/Ubuntu might not be able to guess that AppArmor might be the cause, and they should check for AppArmor denials in the kernel audit log. Add an informational message during startup that: - Only prints when the 'mariadbd' profile is actually loaded - Includes exact commands from the Debian packaging NEWS - Provides actionable paths for local overrides - Mentions both complain and enforce modes for troubleshooting The message is printed once during normal server startup (not in help or bootstrap modes) through the existing logging infrastructure, ensuring it appears in both syslog and the error log where users will see it when troubleshooting startup failures.
| */ | ||
| if (!opt_help && !opt_bootstrap) | ||
| { | ||
| MY_STAT stat_info; |
There was a problem hiding this comment.
no point stat testing before an open. Just open and handle the ENOENT case, which we're just ignoring anyway.
There was a problem hiding this comment.
Sure, makes sense and I will update this accordingly.
| if (mariadb_profile_active) | ||
| { | ||
| sql_print_information( | ||
| "AppArmor profile 'mariadbd' is active. " |
There was a problem hiding this comment.
This is rather verbose for an unconditional start case.
Could be be reduced with a link https://mariadb.com/docs/server/server-management/starting-and-stopping-mariadb/what-to-do-if-mariadb-doesnt-start#apparmor and an extended FAQ o that URL (like what selinux has)?
While it will miss a few cases does putting this as part of a fatal shutdown it useful enough?
There was a problem hiding this comment.
AppArmor denials might also be just silent and not crash the server. Thus I thought that having it show up at startup makes it more visible to those DBAs who it might be affected by AppArmor denials.
When MariaDB fails to start due to permission errors, users on Debian/Ubuntu might not be able to guess that AppArmor might be the cause, and they should check for AppArmor denials in the kernel audit log.
Add an informational message during startup that:
The message is printed once during normal server startup (not in help or bootstrap modes) through the existing logging infrastructure, ensuring it appears in both syslog and the error log where users will see it when troubleshooting startup failures.
This has been in Debian since MariaDB 1:11.8.6-6 via https://salsa.debian.org/mariadb-team/mariadb-server/-/commit/0a896117012567f2325675442be199180eb20a95 and no regressions have been reported. Having this upstream will pave the way to also have the actual new AppArmor profile upstream, as this notice helps users understand what might be breaking their MariaDB instance.