Commit graph

2448 commits

Author SHA1 Message Date
Daniel Black
5d57e04b27 MDEV-27386: cpack rpm libsepol installed detects verison incorrectly
... when two packages are installed.

(fc35 with i686 and x86_64 packages of libsepol installed).
$ rpm -q --qf "%{VERSION}" libsepol
3.33.3

Restricting the version to the current achitecture generates
a much more obtainable version dependency.

$ rpm -q --qf "%{VERSION}" libsepol.x86_64
3.3

This make dependency resolution easier preventing:
$ sudo dnf localinstall  MariaDB-server-10.8.0-1.fc35.x86_64.rpm ...
Last metadata expiration check: 2:06:49 ago on Thu 30 Dec 2021 14:02:32.
Error:
 Problem 1: conflicting requests
  - nothing provides libsepol >= 3.33.3 needed by MariaDB-server-10.8.0-1.fc35.x86_64

The CMAKE_SYSTEM_PROCESSOR is used in the generation of architecture
filenames so its preduent to just use the same version.
2021-12-30 19:48:26 +11:00
Alexey Bychko
467011bcac MDEV-26612 Two different ways to start MariaDB service can cause data corruption
RedHat systems have both files for lsb and init functions.
Old code was written as if/else, so second file (RedHat-specific) was not processed.
So, systemd redirect didn't work, because its logic is described in
RedHat-specific functions file
2021-09-24 15:02:47 +07:00
Alexey Bychko
165a6dc97a MDEV-26119 RPM packages on RHEL-8 require the latest minor
changed rpm db query to output only version for libsepol and not release/buildnumber
2021-07-13 14:30:40 +07:00
Sergei Golubchik
35b57c37bb MDEV-25617 10.5.10 upgrade: "scriptlet / line 6 : [: is-active : binary operator expected" 2021-06-16 12:26:43 +07:00
Daniel Black
a35cde8cd8 MDEV-25513: raise systemd LimitNOFILE limits to match server defaults
Quoting MDEV reporter Daniel Lewart:

Starting MariaDB with default configuration causes the following problems:

    "[Warning] Could not increase number of max_open_files to more than 16384 (request: 32186)"
    silently reduces table_open_cache_instances from 8 (default) to 4

Default Server System Variables:

    extra_max_connections = 1
    max_connections = 151
    table_open_cache = 2000
    table_open_cache_instances = 8
    thread_pool_size = 4

LimitNOFILE=16834 is in the following files:

    support-files/mariadb.service.in
    support-files/mariadb@.service.in

Looking at sql/mysqld.cc lines 3837-3917:
wanted_files= (extra_files + max_connections + extra_max_connections +
tc_size * 2 * tc_instances);
wanted_files+= threadpool_size;

Plugging in the default values:
wanted_files = (30 + 151 + 1 + 2000 * 2 * 8 + 4) = 32186

However, systemd configuration has LimitNOFILE = 16384, which is far smaller.

I suggest increasing LimitNOFILE to 32768.
2021-04-27 08:17:40 +10:00
Alexey Bychko
c0ca3c4ffa MDEV-25240 minor upgrade does not perform server restart
we need to stop server instance on upgrade, but it may be started either by SysV init script or by SystemD.
this commit adds `mysql` target to `systemctl stop` call.
`mysql` may be the name of initscript or an alias while `mariadb` is
a systemd unit file.
2021-03-29 12:19:57 +07:00
Alexey Bychko
9e57bd278f fixed typo in postinst script 2021-03-23 12:37:55 +07:00
Daniel Black
6974058121 mariadb.pc: plugindir is used
As evidenced by converstation on Zulip,
knowing where to install a plugin is important too.
2021-03-18 14:35:55 +11:00
Marko Mäkelä
9d0ee2dcb7 Merge 10.1 into 10.2 2020-09-22 15:21:43 +03:00
Daniel Black
4c19227929 systemd: mariadb@bootstrap - clear ExecStartPre and ExecStartPost
This is just to make sure no ExecStartPre/Post actions from the
multi-instance MariaDB service definition are executed
when a user attempts to start mariadb@bootstrap.

Fixes: 3723c70a30
2020-09-22 15:37:44 +10:00
Oleksandr Byelkin
ef7cb0a0b5 Merge branch '10.1' into 10.2 2020-08-02 11:05:29 +02:00
Daniel Black
c81a2d2322 MDEV-23088: Change LimitNOFILE default from 16364 to 16384
Correct to a true 2^14 rather than some different number that
was actually just a number typo.

Bug report thanks to Hartmut Holzgraefe.
2020-07-28 08:08:20 +10:00
Julius Goryavsky
5f55f69e4a Merge 10.1 into 10.2 2020-06-05 18:32:37 +02:00
Bernard Spil
40dbf0ea0e Fix duplicate word
both both -> both
Closes #1560
2020-06-02 12:57:31 +02:00
Marko Mäkelä
ccaec18b39 Merge 10.1 into 10.2 2020-04-14 16:13:35 +03:00
Marko Mäkelä
26f0cd8afc Merge 5.5 into 10.1 2020-04-14 15:43:12 +03:00
Julius Goryavsky
c8e0c524af MDEV-20676: systemd script not working
When trying to start mariadb via systemctl, WSREP failed
to start mysqld for wsrep recovery, because the binary
"galera-recovery" is neither searching the mysqld in the
same folder as the binary itself nor in the path variable
but instead expects the root to be /usr/local/mysql.

This fix changes the current directory to the desired
directory before starting mysqld.
2020-04-08 13:02:09 +02:00
Hannu Hartikainen
64b70b09e6 my.cnf: mention that config files must be *.cnf
It took me a long time to debug why my configs were not being loaded,
and judging from online discussions I'm not the only one. Make the
comment in the default my.cnf a bit more helpful.

The !includedir directive is implemented in mysys/my_default.c.

- f_extensions[] is a list of file extensions. It includes .ini and .cnf
  on Windows, and only .cnf on all other platforms.
- search_default_file_with_ext() contains the !includedir directive. It
  filters files in the directory to those matching f_extensions[].

This file should only be applicable on Unix-like platforms, so only
files with the .cnf extension are read.

Closes #1485
2020-04-03 14:08:59 +02:00
Vicențiu Ciorbaru
c5c1027c6e MDEV-19208 mariadb.pc: install into libdir
The .pc file installed by mariadb mentions archful directories and
therefore must be archful itself.

This fixes MDEV-14340.
2020-03-05 10:53:16 +02:00
Vicențiu Ciorbaru
da10c6f448 Merge branch '10.1' into 10.2 2020-03-05 10:52:43 +02:00
Ben Boeckel
f21592c675 mariadb.pc: remove unnecessary include directory
When installing, no headers are installed into the parent directory of
`${includedir}`.
2020-02-26 13:18:51 +02:00
Daniel Black
cd5d864fef mariadb{,@}.service comment typo open-file-limit -> open-files-limit 2020-02-25 07:39:31 +01:00
Marko Mäkelä
2daf3b14fe Merge 10.1 into 10.2 2020-01-31 10:53:56 +02:00
Rafli Akmal
742c36d048 MDEV-15052: Allow sysusers and tmpfiles install for non-systemd users
..as they have their own tools that parses those files, such as
opensysusers[1] that handles sysusers file and opentmpfiles[2] that
handles tmpfiles.d settings

Because of this. Move both sysusers and tmpfiles 'if' function
outside systemd function, allowing independent install

Signed-off-by: Rafli Akmal <thefallenrat@artixlinux.org>

[1] - https://github.com/artix-linux/opensysusers
[2] - https://github.com/OpenRC/opentmpfiles

Changes done by vicentiu@mariadb.org, from original author patch:

Installing sysusers and tmpfiles without checking for systemd existence
means that by default, cmake will ALWAYS install these files. Our
general policy is we do not install things which are not needed.
However, there is a valid use case when these files are useful, as is
described above.

To allow this, provide an extra switch that can be enabled during
configuring by doing -DINSTALL_SYSTEMD_{SYSUSERS|TMPFILES}=True

This will use the default path INSTALL_SYSTEMD_{SYSUSERS|TMPFILES}DIR
fetched from install_layout.cmake for rpm & deb based layouts
respectively, or they must be overriden if the install_layout is
standalone.

Example:

cmake . -DINSTALL_SYSTEMD_SYSUSERS=True -DINSTALL_SYSTEMD_SYSUSERSDIR=/etc/sysusers.d
2020-01-24 14:07:19 +02:00
Christian Hesse
b472bc2eba MDEV-17028: Use descriptive file names for sysusers and tmpfiles configuration
These files were installed to:

${INSTALL_SYSTEMD_SYSUSERSDIR}/sysusers.conf
${INSTALL_SYSTEMD_TMPFILESDIR}/tmpfiles.conf

Instead rename the files to more descriptive file names 'mariadb.conf'.
2020-01-24 14:05:20 +02:00
Marko Mäkelä
73985d8301 Merge 10.1 into 10.2 2019-12-23 07:14:51 +02:00
Axel Schwenke
d78f02d73d MDEV-17571 Make systemd timeout behavior more compatible with long Galera SSTs
Set an explicit start and stop timeout of 900 seconds for the
MariaDB Server systemd service
2019-12-05 10:36:20 +01:00
Daniel Black
214023aa0e systemd: mariadb@bootstrap doesn't bootstrap, galera_new_cluster does
Closes #1106
2019-11-14 14:17:13 -08:00
Marko Mäkelä
8688ef22c2 Merge 10.1 to 10.2 2019-11-06 10:18:51 +02:00
Vladislav Vaintroub
dc771113a6 Fix ninja build
Do not rely on existence of CMakeFiles/${target}.dir directory existence
It is not there for custom targets in Ninja build.
2019-11-05 00:20:13 +01:00
Oleksandr Byelkin
36f67a7dff Merge branch '10.1' into 10.2 2019-10-30 21:33:01 +01:00
Sergei Golubchik
8fce180765 MDEV-19432 Systemd service does not get re-enabled after upgrade
following Fedora recommendations (see %systemd_post macro in FC29)
let's do `systemctl preset` on the first installation of the server
2019-10-30 16:46:08 +01:00
Alexander Barkov
f203245e9e Merge remote-tracking branch 'origin/10.1' into 10.2 2019-10-01 07:11:54 +04:00
Sergei Golubchik
677cc64428 chkconfig in RPM server scriptlets
chkconfig --add and --del [might] invoke /sbin/insserv
and even if chkconfig exists, insserv might not (SLES15).

Ignore chkconfig --del errors - it's a "best effort" cleanup anyway
2019-09-27 13:20:11 +02:00
Alexander Barkov
0a359d7627 Merge remote-tracking branch 'origin/10.1' into 10.2 2019-09-24 19:19:25 +04:00
Alexander Barkov
5f118b26c8 Merge remote-tracking branch 'origin/5.5' into 10.1 2019-09-24 11:18:39 +04:00
Marko Mäkelä
44c5144943 Merge 10.1 into 10.2 2019-09-23 08:26:08 +03:00
Christian Hesse
7a4019a1c7 MDEV-19207 systemd service: add instance name in description
The unit files made systemd print:

systemd[1]: Started MariaDB 10.3.13 database server (multi-instance).

Let's add the instance name, so starting mariadb@foo.service
makes it print:

systemd[1]: Started MariaDB 10.3.13 database server (multi-instance foo).
2019-09-21 08:08:52 +03:00
chriscalender
13274032af MDEV-4968 Old advices in mysql-log-rotate script
* Change the comments in mysql-log-rotate.sh to refer to mysqld, not mysqld_safe
  as that's what most distros are using.
* Change err-log to log-error as err-log is no longer valid.
* Convert tab to space for consistency.
2019-09-21 00:13:26 +03:00
Daniel Black
75bcf1f9ad MDEV-12646: systemd service file changes from Fedora
Include comment header that describes overrides.

Unit description now includes @VERSION@.

After=syslog.target removed - redunant

Add --basedir=@prefix to prevent /root/.my.cnf lookups. This is
placed after $MYSQLD_OPTIONS in case a user sets a --{no,}default
type options which has to be first in the mysqld arguements.

Additional changes to multi instance (support-files/mariadb@.service.in):
* added @SYSTEMD_EXECSTARTPRE@ / @SYSTEMD_EXECSTARTPOST@
* removed mariadb@bootstrap reference as galera_new_cluster as
  it's a little too proment.
* use_galera_new_cluster.conf updated to override pre/post steps
  to ensure it has no side effects

Signed-off-by: Daniel Black <daniel@linux.vnet.ibm.com>
2019-09-20 08:59:18 +03:00
Oleksandr Byelkin
cf8c2a3c3b Merge branch '10.1' into 10.2 2019-07-26 07:03:39 +02:00
Oleksandr Byelkin
ae476868a5 Merge branch '5.5' into 10.1 2019-07-25 13:27:11 +02:00
Sergei Golubchik
6e98f6810c fix libsepol version detection for SUSE 2019-07-21 13:12:18 +02:00
Marko Mäkelä
6962855185 Merge 10.1 into 10.2 2019-07-18 13:10:09 +03:00
Sergei Golubchik
578e822985 bugfix: RPM installation complains about policy files, mariadb.service is not installed
add a versioned libsepol dependency to the server rpm
2019-07-10 09:02:10 +02:00
Sergei Golubchik
5d04391f58 MDEV-19726 MariaDB server or backup RPM install assumes mysql user exists
also get rid of

   chown: cannot access ‘/var/lib/mysql’: No such file or directory

before someone reports a bug that
MariaDB server or backup RPM install assumes mysql datadir exists

followup for bee24fe181
2019-07-10 08:58:28 +02:00
Mostafa Hussein
8997f20f12 use -f with pgrep
pgrep will not be able to get th pid using the full path which is $libexec/mysqld unless -f is being used
2019-07-08 04:21:18 -07:00
Marko Mäkelä
26a14ee130 Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
Vicențiu Ciorbaru
cb248f8806 Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
Vicențiu Ciorbaru
5543b75550 Update FSF Address
* Update wrong zip-code
2019-05-11 21:29:06 +03:00