Skip to content

Separate the client binary and engine flavour from the service name - #607

Closed
mcowser-p wants to merge 1 commit into
geerlingguy:masterfrom
mcowser-p:fix/separate-daemon-client-and-flavour
Closed

Separate the client binary and engine flavour from the service name#607
mcowser-p wants to merge 1 commit into
geerlingguy:masterfrom
mcowser-p:fix/separate-daemon-client-and-flavour

Conversation

@mcowser-p

Copy link
Copy Markdown

On Enterprise Linux running real MySQL (not MariaDB), this role cannot complete: the systemd unit is mysqld while the client binary is mysql, and mysql_daemon has to be both at once.

The three meanings

mysql_daemon is currently used as:

  1. the systemd unitservice: name={{ mysql_daemon }}
  2. the client binarysecure-installation.yml:25, command: {{ mysql_daemon }} -NBe "..." (six call sites)
  3. the engine flavourmysql_daemon == 'mariadb' / == 'mysql' (seven tests)

That is coherent wherever the three share a name: MariaDB everywhere, and MySQL on Debian, where the unit really is mysql. On EL + MySQL there is no value that works:

value client flavour unit
mariadb (EL default) not installed wrong engine wrong
mysqld runs the server with client flags matches neither test correct
mysql correct correct wrong

The mysqld case is the unpleasant one: mysqld -NBe "DELETE FROM mysql.user ..." tries to start a database with client arguments, blocks for ~100 seconds, then exits 1.

The change

Adds mysql_client and mysql_flavour, both defaulting to mysql_daemon, so every existing playbook is unaffected. Client invocations use mysql_client; flavour comparisons use mysql_flavour.

Callers who need the split set it explicitly:

mysql_daemon:  mysqld
mysql_client:  mysql
mysql_flavour: mysql

Testing

Found and verified running MySQL 8.0.46 on AlmaLinux 9 and MySQL 8.4 on Ubuntu 26.04. With the change, a host that had failed at mariadb --version on every run now completes the role cleanly. Debian is unaffected either way, which is why this has stayed hidden.

🤖 Generated with Claude Code

mysql_daemon has meant three things at once: the systemd unit, the client
binary, and the engine flavour. That is coherent wherever the three share a
name -- MariaDB everywhere, and MySQL on Debian, where the unit really is
`mysql`.

It is not coherent for MySQL on Enterprise Linux, where the unit is `mysqld`
and the client is `mysql`. No single value works:

  mariadb   wrong on all three. It is the EL default, so a host running real
            MySQL fails at `mariadb --version` with "Error executing command"
  mysqld    correct unit, but runs the SERVER binary with client flags --
            `mysqld -NBe "DELETE FROM mysql.user ..."` sits for 100 seconds
            trying to start a database, then exits 1 -- and matches neither
            flavour test, since those compare against 'mysql' and 'mariadb'
  mysql     correct client and flavour, wrong unit

Adds mysql_client and mysql_flavour, both defaulting to mysql_daemon, so
every existing playbook is unaffected. secure-installation.yml now invokes
mysql_client for its six client calls and compares mysql_flavour in its
seven engine tests; configure.yml uses mysql_client for --version.

Set the new variables only where the three genuinely differ:

  mysql_daemon:  mysqld
  mysql_client:  mysql
  mysql_flavour: mysql

Found running MySQL 8.0 on AlmaLinux 9 and 8.4 on Ubuntu 26.04 in a
disaster-recovery lab. The Debian side never surfaces it, which is why it
has stayed hidden: there, one value happens to satisfy all three roles.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mcowser-p

Copy link
Copy Markdown
Author

Closing — I opened this prematurely. Keeping the change on a private fork for now; will resubmit if it's useful upstream later. Apologies for the noise.

@mcowser-p mcowser-p closed this Aug 29, 2026
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.

1 participant