[MDEV-15627] debian packages install /etc/mysql/mariadb.cnf however its not read by default Created: 2018-03-22  Updated: 2018-05-23  Resolved: 2018-05-23

Status: Closed
Project: MariaDB Server
Component/s: Packaging, Platform Debian
Affects Version/s: 10.3
Fix Version/s: 10.3.7

Type: Bug Priority: Critical
Reporter: Daniel Black Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None
Environment:

ubuntu artful (power9)



 Description   

$ mysqld --help --verbose
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf 

~$ dpkg-deb  --extract mariadb-common_10.3.6+maria~artful_all.deb /tmp/mc
$ find /tmp/mc
/tmp/mc
/tmp/mc/usr
/tmp/mc/usr/share
/tmp/mc/usr/share/doc
/tmp/mc/usr/share/doc/mariadb-common
/tmp/mc/usr/share/doc/mariadb-common/copyright
/tmp/mc/usr/share/doc/mariadb-common/changelog.gz
/tmp/mc/etc
/tmp/mc/etc/mysql
/tmp/mc/etc/mysql/mariadb.cnf
/tmp/mc/etc/mysql/mariadb.conf.d

Other packages nicely install their config file in /etc/mysql/mariadb.conf.d/ however they aren't ever read.

 find /etc/mysql/mariadb.conf.d/ -ls
  1310736      4 drwxr-xr-x   2 root     root         4096 Mar 21 21:00 /etc/mysql/mariadb.conf.d/
  1312766      4 -rw-r--r--   1 root     root           53 Mar 21 20:41 /etc/mysql/mariadb.conf.d/cracklib_password_check.cnf
  1312769      4 -rw-r--r--   1 root     root           40 Mar 21 20:41 /etc/mysql/mariadb.conf.d/rocksdb.cnf
  1312765      4 -rw-r--r--   1 root     root           40 Mar 21 20:41 /etc/mysql/mariadb.conf.d/connect.cnf
  1312768      4 -rw-r--r--   1 root     root           40 Mar 21 20:41 /etc/mysql/mariadb.conf.d/oqgraph.cnf
  1312763      4 -rw-r--r--   1 root     root           48 Mar 21 20:41 /etc/mysql/mariadb.conf.d/aws_key_management.cnf
  1312754      4 -rw-r--r--   1 root     root          647 Mar 21 20:02 /etc/mysql/mariadb.conf.d/config.cnf
  1312764      4 -rw-r--r--   1 root     root          767 Mar 21 19:07 /etc/mysql/mariadb.conf.d/enable_encryption.preset
  1312767      4 -rw-r--r--   1 root     root           41 Mar 21 20:41 /etc/mysql/mariadb.conf.d/auth_gssapi.cnf

Was something like the following intended? Or altering the default mysqld list of read files?

/etc/mysql/conf.d/mariadb.cnf

 
!include /etc/mysql/mariadb.cnf



 Comments   
Comment by Daniel Black [ 2018-04-01 ]

Change from over a year ago:

https://jira.mariadb.org/browse/MDEV-11869?focusedCommentId=90922&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-90922

If the intent is to read /etc/mysql/mariadb.cnf then this needs to be built in to mysqld. A macro e.g. SYSCONFFILEBASE equating to /etc/mysql/mariadb would be good as it seems from https://jira.mariadb.org/browse/MDEV-11869?focusedCommentId=90993&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-90993 that MYSQLD_MULTI_INSTANCE=--defaults-file=@sysconffilebase@%I.cnf is desired as the debian default.

Which files are intended for the client programs, mysql, mysqldump etc. to read by by default? Currently they are the same as mysqld.

If the intent is to read /etc/mysql/mariadb.conf.d files and not /etc/mysql/conf.d then the INSTALL_SYSCONF2DIR should be set to the former. When this happens the debian/mariadb-plugin*install maps are no-longer needed. debian/additions/enable_encryption.preset and ./support-files/rpm/enable_encryption.preset could be one file if the correct layout/macros where used by the Debian build system.

Comment by Daniel Black [ 2018-04-12 ]

ssh root@10.61.254.138
Host key fingerprint is SHA256:cfN54JRqxVjtoi9RLJ4vgDL+jz1sAz5Pl7Uv7JaBTqs
+---[ECDSA 256]---+
|            ..   |
|           + ..  |
|        . +.*.   |
|         o.B+o.  |
|       .S.o*=..  |
|    o o ..Bo.o   |
|   . + o.+o*.o   |
|    . o+=.= B.   |
|     .o=E+ =...  |
+----[SHA256]-----+
root@10.61.254.138's password: 
Welcome to Ubuntu Bionic Beaver (development branch) (GNU/Linux 4.13.0-32-generic ppc64le)
 
root@galera1:~#  apt-get install -y systemd software-properties-common && add-apt-repository -y ppa:mysql-ubuntu/mariadb-10.3
root@galera1:~# wget 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xAB13149B06728E98' -O - | apt-key add -
root@galera1:~# rm -rf  /etc/mysql/
root@galera1:~# apt update
root@galera1:~# apt install mariadb-plugin-rocksdb
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  chrpath cmake cmake-data comerr-dev cracklib-runtime dh-apparmor dh-systemd dpatch gir1.2-harfbuzz-0.0 icu-devtools krb5-multidev libaio-dev libarchive-dev libarchive13 libboost-dev libboost1.65-dev
  libconfig-inifiles-perl libcrack2 libcrack2-dev libcurl3 libglib2.0-bin libglib2.0-dev libglib2.0-dev-bin libgraphite2-dev libgssrpc4 libharfbuzz-dev libharfbuzz-gobject0 libharfbuzz-icu0 libicu-dev
  libicu-le-hb-dev libjemalloc-dev libjemalloc1 libjsoncpp1 libjudy-dev libjudydebian1 libkadm5clnt-mit11 libkadm5srv-mit11 libkdb5-9 libkrb5-dev liblzo2-2 libncurses5-dev libnuma-dev libodbc1 libpam0g-dev
  libpcre16-3 libpcre3-dev libpcre32-3 libpcrecpp0v5 libreadline-gplv2-dev librhash0 libsnappy-dev libssl1.0-dev libsystemd-dev libtinfo-dev libuv1 libxml2-dev odbcinst odbcinst1debian2 pkg-config
  unixodbc-dev uuid-dev zlib1g-dev
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
  galera-3 gawk libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient20 libpython-stdlib libpython2.7-minimal libpython2.7-stdlib libterm-readkey-perl mariadb-client-10.3
  mariadb-client-core-10.3 mariadb-common mariadb-server-10.3 mariadb-server-core-10.3 mysql-common python python-minimal python-mysqldb python2.7 python2.7-minimal socat
Suggested packages:
  gawk-doc libmldbm-perl libnet-daemon-perl libsql-statement-perl libipc-sharedcache-perl mailx mariadb-test tinyca python-doc python-tk python-egenix-mxdatetime python-mysqldb-dbg python2.7-doc
  binfmt-support
The following NEW packages will be installed:
  galera-3 gawk libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient20 libpython-stdlib libpython2.7-minimal libpython2.7-stdlib libterm-readkey-perl mariadb-client-10.3
  mariadb-client-core-10.3 mariadb-common mariadb-plugin-rocksdb mariadb-server-10.3 mariadb-server-core-10.3 mysql-common python python-minimal python-mysqldb python2.7 python2.7-minimal socat
0 to upgrade, 23 to newly install, 0 to remove and 259 not to upgrade.
Need to get 19.9 MB/21.6 MB of archives.
After this operation, 195 MB of additional disk space will be used.
Do you want to continue? [Y/n] yy
....
Setting up python2.7 (2.7.14-8) ...
Setting up mariadb-server-10.3 (1:10.3.0~ubuntu18.04.1~1523475283.1585a229588) ...
2018-04-12 15:12:36 0 [Note] /usr/sbin/mysqld (mysqld 10.3.6-MariaDB-1:10.3.0~ubuntu18.04.1~1523475283.1585a22958) starting as process 8889 ...
2018-04-12 15:12:36 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-04-12 15:12:36 0 [Note] InnoDB: Uses event mutexes
2018-04-12 15:12:36 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2018-04-12 15:12:36 0 [Note] InnoDB: Using Linux native AIO
2018-04-12 15:12:36 0 [Note] InnoDB: Number of pools: 1
2018-04-12 15:12:36 0 [Note] InnoDB: Using POWER8 crc32 instructions
2018-04-12 15:12:36 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
2018-04-12 15:12:36 0 [Note] InnoDB: Completed initialization of buffer pool
2018-04-12 15:12:36 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2018-04-12 15:12:37 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2018-04-12 15:12:37 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-04-12 15:12:37 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2018-04-12 15:12:37 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2018-04-12 15:12:37 0 [Note] InnoDB: 5.7.21 started; log sequence number 1632468; transaction id 21
2018-04-12 15:12:37 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2018-04-12 15:12:37 0 [Note] Plugin 'FEEDBACK' is disabled.
2018-04-12 15:12:37 0 [Note] InnoDB: Buffer pool(s) load completed at 180412 15:12:37
Created symlink /etc/systemd/system/mysql.service → /lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/mysqld.service → /lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /lib/systemd/system/mariadb.service.
Setting up libpython-stdlib:ppc64el (2.7.14-4) ...
Setting up mariadb-plugin-rocksdb (1:10.3.0~ubuntu18.04.1~1523475283.1585a229588) ...
Setting up libdbd-mysql-perl (4.046-1) ...
Setting up python (2.7.14-4) ...
Setting up python-mysqldb (1.3.10-1build1) ...
Processing triggers for libc-bin (2.27-0ubuntu3) ...
Processing triggers for systemd (237-3ubuntu7) ...
Processing triggers for ureadahead (0.100.0-20) ...
root@galera1:~# find /etc/mysql/ -ls
   393219      4 drwxr-xr-x   4 root     root         4096 Apr 12 15:12 /etc/mysql/
   396842      4 drwxr-xr-x   2 root     root         4096 Apr 12 15:12 /etc/mysql/conf.d
   397124      4 -rw-r--r--   1 root     root           36 Mar 10  2017 /etc/mysql/conf.d/mysqld_safe_syslog.cnf
   396861      8 -rw-r--r--   1 root     root         5232 Apr  9  2017 /etc/mysql/my.cnf
   397120      4 drwxr-xr-x   2 root     root         4096 Apr 12 15:12 /etc/mysql/mariadb.conf.d
   397130      4 -rw-r--r--   1 root     root           40 Apr 12 05:34 /etc/mysql/mariadb.conf.d/rocksdb.cnf
   397131      4 -rw-------   1 root     root          333 Apr 12 15:12 /etc/mysql/debian.cnf
   397125      4 -rwxr-xr-x   1 root     root         1509 Apr  1 05:34 /etc/mysql/debian-start
   396864      4 -rw-r--r--   1 root     root          527 Dec 29 21:38 /etc/mysql/mariadb.cnf
root@galera1:~# cat /etc/mysql/mariadb.conf.d/rocksdb.cnf
[mariadb]
plugin-load-add=ha_rocksdb.so
root@galera1:~# mysql -u root -p
Enter password: 
MariaDB [(none)]> pager grep -i rocks
PAGER set to 'grep -i rocks'
MariaDB [(none)]> show plugins;
53 rows in set (0.003 sec)
 
MariaDB [(none)]> shutdown
root@galera1:~# echo -e  '[mariadb]\ninnodb-buffer-pool-size=4G' > /etc/mysql/mariadb.conf.d/innodb.cnf
root@galera1:~# cat /etc/mysql/mariadb.conf.d/innodb.cnf
[mariadb]
innodb-buffer-pool-size=4G
root@galera1:~# systemctl restart mariadb
root@galera1:~# mysql -u root -p -e 'SELECT @@innodb_buffer_pool_size'
Enter password:
+---------------------------+
| @@innodb_buffer_pool_size |
+---------------------------+
|                 268435456 |
+---------------------------+

So no plugin loaded and /etc/mysql/mariadb.conf.d/innodb.cnf not read. written about it on mariadb-developers and therefore critical packaging bug.

Comment by Daniel Black [ 2018-04-12 ]

And /etc/mysql/mariadb.cnf containing character set settings, shouldn't this be in /etc/mysql/mariadb.conf.d/charset.cnf

And tmpfiles: MDEV-15502 , https://github.com/MariaDB/server/pull/530

And MDEV-14622 is pretty important too.

Comment by Otto Kekäläinen [ 2018-04-12 ]

This is my priority nr 1 after I have some other commits tested and merged in 10.3 first.

Generated at Thu Feb 08 08:22:49 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.