linuxserver / docker-mariadb

GNU General Public License v3.0
212 stars 46 forks source link

[BUG] /etc/my.cnf.d/custom.cnf not being used by mariadb #148

Closed Jashepp closed 1 month ago

Jashepp commented 4 months ago

Is there an existing issue for this?

Current Behavior

/etc/my.cnf.d/custom.cnf (linked to /config/custom.cnf) is currently not being used by mariadb. Any edits I do in custom.cnf (with rebooting/recreating container after edits), are ignored.

Expected Behavior

custom.cnf is meant to be used by mariadb, which upon startup is sym linked, to be within the /etc/my.cnf.d/ directory: https://github.com/linuxserver/docker-mariadb/blob/11743a1c76cc54423b644002f20f80a67427c994/root/etc/s6-overlay/s6-rc.d/init-mariadb-config/run#L13 However there is no existing/default configuration that's including the /etc/my.cnf.d/ directory, hence custom.cnf is not used: https://mariadb.com/kb/en/configuring-mariadb-with-option-files/#including-option-file-directories

Unless I am somehow missing something obvious?

Steps To Reproduce

  1. Have debian with docker installed
  2. docker compose up with the provided compose yaml snippet
  3. edit ./data/custom.cnf (in my case, I set query_cache_type = ON)
  4. docker compose down, then docker compose up again.
  5. mariadb does not reflect changed configuration (looked at the variable, and it was still default/unchanged, eg; SHOW GLOBAL VARIABLES WHERE Variable_name='query_cache_type')

Environment

- OS: Debian GNU/Linux 11 (bullseye) x86_64
- How docker service was installed: Debian's package manager `apt`

CPU architecture

x86-64

Docker creation

version: "3"

services:
  db:
    container_name: db
    image: linuxserver/mariadb
    restart: unless-stopped
    hostname: 'db.local'
    ports:
      - 3306:3306
    expose:
      - '3306'
    environment:
      PUID: 1000
      PGID: 1000
      MYSQL_DATABASE: [redacted]
      MYSQL_USER: [redacted]
      MYSQL_PASSWORD: [redacted]
      MYSQL_ROOT_PASSWORD: [redacted]
    volumes:
      - '/var/log/docker/db:/var/log'
      - '/var/log/docker/db-config-log:/config/log'
      - './data:/config'
      #- './data/custom.cnf:/etc/my.cnf:ro' # uncomment this for quick workaround
    networks:
      - servers-web1
    deploy:
      resources:
        limits:
          cpus: '14'
          memory: 8192M

networks:
  servers-web1:
    external: true

Container logs

[migrations] started
[migrations] no migrations found
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    1000
───────────────────────────────────────
Linuxserver.io version: 10.11.8-r0-ls148
Build-date: 2024-07-02T07:44:42+00:00
───────────────────────────────────────

[custom-init] No custom files found, skipping...
240705 22:46:33 mysqld_safe Logging to '/config/databases/db.local.err'.
240705 22:46:33 mysqld_safe Starting mariadbd daemon with databases from /config/databases
Connection to localhost (127.0.0.1) 3306 port [tcp/mysql] succeeded!
[ls.io-init] done.
github-actions[bot] commented 4 months ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

aptalca commented 4 months ago

All persistent settings and config files reside in the config folder.

You shouldn't be mapping/overwriting files inside the container unless the readme says so.

Closing as it's not a bug.

Jashepp commented 4 months ago

I'm saying that the /config/custom.cnf config file isn't being used/read by mariadb at all.

aptalca commented 4 months ago

My bad, I thought you were mapping a file into the container based on the compose yaml.

This was working last I tested, but needs furtehr investigating.

LinuxServer-CI commented 3 months ago

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 2 weeks ago

This issue is locked due to inactivity