Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MariaDB fails to start on Debian 12 #18236

Closed
sparkhom opened this issue Sep 3, 2024 · 5 comments
Closed

MariaDB fails to start on Debian 12 #18236

sparkhom opened this issue Sep 3, 2024 · 5 comments
Labels
stale No recent activity

Comments

@sparkhom
Copy link

sparkhom commented Sep 3, 2024

Steps to reproduce:

  1. brew install mariadb
  2. brew services start mariadb

Expected:

==> Successfully started `mariadb` (label: homebrew.mariadb)
sparkhom@GAIA:~$ systemctl --user status homebrew.mariadb.service
● homebrew.mariadb.service - Homebrew generated unit for mariadb
     Loaded: loaded (/home/sparkhom/.config/systemd/user/homebrew.mariadb.service; enabled; preset: enabled)
     Active: active (running) since Mon 2024-09-02 21:36:12 PDT; 1s ago
   Main PID: 177 (mariadbd-safe)
     CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/homebrew.mariadb.service
             ├─177 /bin/sh /home/linuxbrew/.linuxbrew/opt/mariadb/bin/mariadbd-safe --datadir=/home/linuxbrew/.linuxbrew/var/mysql
             └─261 /home/linuxbrew/.linuxbrew/opt/mariadb/bin/mariadbd --basedir=/home/linuxbrew/.linuxbrew/opt/mariadb --datadir=/home/linuxbrew/.linuxbrew/var/mysql --plugin-dir=/home/linuxbrew/.linuxbrew/opt/mariadb/lib/plugin ->

Actual:

==> Successfully started `mariadb` (label: homebrew.mariadb)
sparkhom@GAIA:~$ systemctl --user status homebrew.mariadb.service
× homebrew.mariadb.service - Homebrew generated unit for mariadb
     Loaded: loaded (/home/sparkhom/.config/systemd/user/homebrew.mariadb.service; enabled; preset: enabled)
     Active: failed (Result: start-limit-hit) since Mon 2024-09-02 21:36:35 PDT; 1s ago
   Duration: 361ms
    Process: 1330 ExecStart=/home/linuxbrew/.linuxbrew/opt/mariadb/bin/mariadbd-safe --datadir\=/home/linuxbrew/.linuxbrew/var/mysql (code=exited, status=0/SUCCESS)
   Main PID: 1330 (code=exited, status=0/SUCCESS)

Sep 02 21:36:35 GAIA systemd[161]: homebrew.mariadb.service: Scheduled restart job, restart counter is at 6.
Sep 02 21:36:35 GAIA systemd[161]: Stopped homebrew.mariadb.service - Homebrew generated unit for mariadb.
Sep 02 21:36:35 GAIA systemd[161]: homebrew.mariadb.service: Start request repeated too quickly.
Sep 02 21:36:35 GAIA systemd[161]: homebrew.mariadb.service: Failed with result 'start-limit-hit'.
Sep 02 21:36:35 GAIA systemd[161]: Failed to start homebrew.mariadb.service - Homebrew generated unit for mariadb.

I looked into it further and it looks like the ExecStart command has an extra backslash after --datadir:

ExecStart=/home/linuxbrew/.linuxbrew/opt/mariadb/bin/mariadbd-safe --datadir\=/home/linuxbrew/.linuxbrew/var/mysql

Removing the backslash fixes the issue and allows MariaDB to start:

ExecStart=/home/linuxbrew/.linuxbrew/opt/mariadb/bin/mariadbd-safe --datadir=/home/linuxbrew/.linuxbrew/var/mysql
@MikeMcQuaid MikeMcQuaid transferred this issue from Homebrew/homebrew-services Sep 3, 2024
@carlocab
Copy link
Member

carlocab commented Sep 3, 2024

Doesn't seem to be coming from the service block:

https://github.com/Homebrew/homebrew-core/blob/bd6394bad2c4f2cc77c4298573f6bf818b991c90/Formula/m/mariadb.rb#L174-L178

So probably introduced when brew translates the service block into a systemd unit file.

What's the output of brew config and brew doctor?

@carlocab carlocab transferred this issue from Homebrew/homebrew-core Sep 3, 2024
@cho-m
Copy link
Member

cho-m commented Sep 3, 2024

The backslash is from:

cmd = command&.map { |arg| Utils::Shell.sh_quote(arg) }

str.gsub!(UNSAFE_SHELL_CHAR, "\\\\" + "\\1") # rubocop:disable Style/StringConcatenation


Systemd uses its own (non-POSIX) handling so may need to modify the command to match. May have to check on exact handling of backslashes (i.e. the ones Systemd handles vs. the ones shell handles and how it gets passed down).

@sparkhom
Copy link
Author

sparkhom commented Sep 4, 2024

What's the output of brew config and brew doctor?

sparkhom@GAIA:~$ brew config
HOMEBREW_VERSION: 4.3.19
ORIGIN: https://github.com/Homebrew/brew
HEAD: 1f9bd2de89883ec9a59db3eab0f5475bce06d5bc
Last commit: 2 days ago
Core tap JSON: 03 Sep 03:09 UTC
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: :0
HOMEBREW_MAKE_JOBS: 12
Homebrew Ruby: 3.3.4 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.4_1/bin/ruby
CPU: dodeca-core 64-bit zen
Clang: N/A
Git: 2.39.2 => /bin/git
Curl: 7.88.1 => /bin/curl
Kernel: Linux 5.15.153.1-microsoft-standard-WSL2 x86_64 GNU/Linux
OS: Debian GNU/Linux 12 (bookworm)
WSL: 2 (Microsoft Store)
Host glibc: 2.36
/usr/bin/gcc: 12.2.0
/usr/bin/ruby: N/A
glibc: N/A
gcc@11: N/A
gcc: N/A
xorg: N/A
sparkhom@GAIA:~$ brew doctor
Your system is ready to brew.

Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@ZhongRuoyu
Copy link
Member

This has been fixed by #18865 and will be available to all users after the next Homebrew release. After updating to the new release, run brew reinstall mariadb to have the systemd unit file fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale No recent activity
Projects
None yet
Development

No branches or pull requests

4 participants