Skip to content

mariadb: use mariadbd as executable name - #30495

Open
grooverdan wants to merge 1 commit into
openwrt:masterfrom
grooverdan:mariadb_name_fix
Open

mariadb: use mariadbd as executable name#30495
grooverdan wants to merge 1 commit into
openwrt:masterfrom
grooverdan:mariadb_name_fix

Conversation

@grooverdan

@grooverdan grooverdan commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

📦 Package Details

Maintainer: @miska

Description:

mariadbd is the executable name since 10.4
and mysqld is provided as backward compatibility only.

🧪 Run Testing Details

  • OpenWrt Version:
  • OpenWrt Target/Subtarget:
  • OpenWrt Device:

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

If your PR contains a patch:

  • It can be applied using git am
  • It has been refreshed to avoid offsets, fuzzes, etc., using
    make package/<your-package>/refresh V=s
  • [N/A] It is structured in a way that it is potentially upstreamable
    (e.g., subject line, commit description, etc.)
    We must try to upstream patches to reduce maintenance burden.

@openwrt

openwrt Bot commented Sep 10, 2026

Copy link
Copy Markdown

Formality Check: Suggestions Available

We checked this pull request against the contribution guidelines. Here is what needs your attention:

⚠️ STYLISTIC WARNINGS & SUGGESTIONS

Package Release Audit:

  • ⚠️ Content changed in these packages, but without a PKG_RELEASE or version bump:

    • utils/mariadb

    Increment PKG_RELEASE by 1 (or bump PKG_VERSION/PKG_SOURCE_DATE and reset PKG_RELEASE to 1) so users receive the update.

Do not increment release for minor changes. Cosmetic edits (e.g., typos in comments, copyright updates, formatting/whitespace), changing the package maintainer (PKG_MAINTAINER), or updating source download info (PKG_SOURCE_URL / PKG_HASH) do not require incrementing PKG_RELEASE.


Something broken? Consider reporting an issue.
Running version 059e3de deployed on 2026-09-09 11:53:18 CEST

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 new commit.


Generated by Claude Code

Comment thread utils/mariadb/files/mysqld.init Outdated
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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

corrected in top Makefile

Comment thread utils/mariadb/files/mysqld.init Outdated
Comment thread utils/mariadb/files/mysqld.init
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>

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 new commit.


Generated by Claude Code

Comment thread utils/mariadb/Makefile

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)))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Suggested change
[ $(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"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread utils/mariadb/Makefile

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants