mariadb: use mariadbd as executable name - #30495
Conversation
Formality Check: Suggestions AvailableWe checked this pull request against the contribution guidelines. Here is what needs your attention:
|
a596b79 to
e82cc87
Compare
| if [ "$init_db" -gt 0 ]; then | ||
| # shellcheck disable=SC2154 | ||
| mysql_install_db $args --skip-name-resolve --skip-test-db --datadir="$datadir" || exit 1 | ||
| mariadb-install-db $args --skip-name-resolve --skip-test-db --datadir="$datadir" || exit 1 |
There was a problem hiding this comment.
No mariadb-install-db is shipped: MARIADB_SERVER lists mysql_install_db and the install macro's $(subst mysql,mariadb,...) yields the underscore form mariadb_install_db, so this aborts init with || exit 1. Use the name that is actually installed, or add the hyphenated script to the Makefile. Same on line 126.
| mariadb-install-db $args --skip-name-resolve --skip-test-db --datadir="$datadir" || exit 1 | |
| mariadb_install_db $args --skip-name-resolve --skip-test-db --datadir="$datadir" || exit 1 |
Generated by Claude Code
There was a problem hiding this comment.
corrected in top Makefile
mariadbd is the executable name since 10.4 and mysqld is provided as backward compatibility only. Also use mariadb-install-db as it was introduced at the same time. Signed-off-by: Daniel Black <daniel@mariadb.org>
e82cc87 to
aa99e5b
Compare
|
|
||
| define Package/mariadb/install/bin | ||
| $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(2) $(1)/usr/bin | ||
| [ $(2) = $(subst mysql,mariadb,$(subst _,-,$(2))) ] || ln -s $(2) $(1)/usr/bin/$(subst mysql,mariadb,$(subst _,-,$(2))) |
There was a problem hiding this comment.
For every mysql* name without an underscore (mysqld, mysql, mysqlcheck, mysqladmin, mysqldump, …) the _→- substitution is a no-op, so this line and the next one both emit ln -s for the same target — the second fails with File exists and aborts the build, which is why all ten CI targets are red:
ERROR: package/feeds/packages_ci/mariadb failed to build.
make[1]: *** [package/Makefile:198: package/feeds/packages_ci/mariadb/compile] Error 1
It also invents aliases upstream does not ship for every non-mysql name containing an underscore (my-print-defaults, aria-chk, myisam-ftdump, resolve-stack-dump, wsrep-sst-*). Gating on "name is a mysql* name" and "hyphen form differs from the plain form" fixes both:
| [ $(2) = $(subst mysql,mariadb,$(subst _,-,$(2))) ] || ln -s $(2) $(1)/usr/bin/$(subst mysql,mariadb,$(subst _,-,$(2))) | |
| [ $(2) = $(subst mysql,mariadb,$(2)) ] || [ $(subst mysql,mariadb,$(2)) = $(subst mysql,mariadb,$(subst _,-,$(2))) ] || ln -s $(2) $(1)/usr/bin/$(subst mysql,mariadb,$(subst _,-,$(2))) |
Generated by Claude Code
| [ -x "$LOGGER" ] || LOGGER="echo" | ||
|
|
||
| MYSQLD="/usr/bin/$NAME" | ||
| MYSQLD="/usr/bin/mariadbd" |
There was a problem hiding this comment.
mariadbd is the symlink: Package/mariadb/install/bin copies mysqld in as the real file and links mariadbd to it, so readlink /proc/<pid>/exe at line 54 always yields /usr/bin/mysqld and the = "$MYSQLD" test can never be true. mysqld_status check_alive therefore always reports dead, so the "server is already running" guard in start_service is dead code. Either compare against the resolved path (readlink -f "$MYSQLD") on line 54, or make mysqld the installed name here and let MYSQLD point at the real file.
Generated by Claude Code
There was a problem hiding this comment.
PKG_RELEASE stays at 1 while the install logic and the init script change, so existing installs never see the fix. Bump it to 2.
Generated by Claude Code
📦 Package Details
Maintainer: @miska
Description:
mariadbd is the executable name since 10.4
and mysqld is provided as backward compatibility only.
🧪 Run Testing Details
✅ Formalities
If your PR contains a patch:
git am(e.g., subject line, commit description, etc.)
We must try to upstream patches to reduce maintenance burden.