Commit graph

24 commits

Author SHA1 Message Date
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
Marko Mäkelä
ccaec18b39 Merge 10.1 into 10.2 2020-04-14 16:13:35 +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
Vicențiu Ciorbaru
da10c6f448 Merge branch '10.1' into 10.2 2020-03-05 10:52:43 +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ä
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
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
Daniel Black
f9179b36d3 systemd: revert to KillMode=control-group for galera
When galera is used we want a stop to kill off not only the mysqld
process but the entire process group created by galera to perform
sst or wsrep_notify_cmd.`
2018-01-29 14:57:02 +04:00
Daniel Black
ce4cdfa0f8 MDEV-13809: [service] should [Service] in systemd service files 2017-12-19 12:53:24 +04:00
Daniel Black
64f1fab068 MDEV-12128: systemd - add Documentation= directives 2017-12-19 12:48:34 +04:00
Christian Hesse
ea31755760 properly set paths in systemd unit files
Use variables in systemd unit file templetes to properly set paths in
final systemd unit files.
2017-03-07 15:02:37 +02:00
klemens
7be541f281 spelling fixes 2017-03-07 13:38:06 +04:00
Nirbhay Choubey
3ac0721a3c MDEV-10507: MariaDB 10.1 + wsrep fails to start under systemd post-reboot
/var/run/mysqld must be created before wsrep recovery.
2016-08-22 19:06:32 -04:00
Nirbhay Choubey
294961cc4d MDEV-10538: MariaDB fails to start without galera_recovery in systemd mode
Update ExecStartPre scripts to not fail if 'galera_recovery'
script is not available.
2016-08-22 18:38:06 -04:00
Sergey Vojtovich
1e160e5cb3 MDEV-10404 - Improved systemd service hardening causes SELinux problems
Disabled NoNewPrivileges until SELinux policy is fixed.
2016-08-17 13:59:00 +04:00
Craig Andrews
53e7fcca41 MDEV-10298: Systemd hardening
Add ProtectSystem=full, NoNewPrivileges=true, PrivateDevices=true, and ProtectHome=true to the systemd units.
2016-07-12 19:43:35 +04:00
Nirbhay Choubey
a6816995ee MDEV-10004: Galera's pc.recovery process fails in 10.1 with systemd
Galera recovery process works in two phases. In the first
phase, mysqld is started as non-daemon with --wsrep-recover
to recover and fetch the last logged global transaction ID.
This ID is then used in second phase as the start position
(--wsrep-start-position=XX) to start mysqld as daemon.

As this process was implemented in mysqld_safe script, the
recovery did not work when server was started using systemd.

Fixed by introducing a shell script (wsrep_recovery.sh) that
mimics the first phase of the recovery process.
2016-06-27 18:03:24 -04:00
Sergey Vojtovich
27e6fd9a59 MDEV-9095 - [PATCH] systemd capability for --memlock
Adjust systemd files to enable CAP_IPC_LOCK to allow rootless mlockall
(triggered by memlock option).

This is amended version of a patch originally submitted by Daniel Black.
2015-12-22 19:13:51 +04:00
Daniel Black
d6b430c91b MDEV-8995: systemd - 16K open-files-limit by default 2015-11-07 13:40:44 +11:00
Daniel Black
a2c3549404 MDEV-427: systemd - use galera_new_cluster instead of bootstrap
Use galera_new_cluster instead. systemctl start mariadb@bootstrap
will generate error message, use_galera_new_cluster.conf is the name
of the file that will generate this error.

Output:

Job for mariadb@bootstrap.service failed. See "systemctl status
mariadb@bootstrap.service" and "journalctl -xe" for details.

● mariadb@bootstrap.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb@.service; disabled;
vendor preset: disabled)
  Drop-In: /usr/lib/systemd/system/mariadb@bootstrap.service.d
           └─use_galera_new_cluster.conf
   Active: failed (Result: exit-code) since Thu 2015-10-15 19:27:52
CEST; 5s ago
  Process: 24334 ExecStart=/usr/bin/false (code=exited,
status=1/FAILURE)
  Process: 24330 ExecStart=/usr/bin/echo Please use galera_new_cluster
to start the mariadb service with --wsrep-new-cluster (code=exited,
status=0/SUCCESS)
 Main PID: 24334 (code=exited, status=1/FAILURE)

Oct 15 19:27:52 spaceman systemd[1]: Starting MariaDB database server...
Oct 15 19:27:52 spaceman systemd[1]: mariadb@bootstrap.service: main
process exited, code=exited, status=1/FAILURE
Oct 15 19:27:52 spaceman systemd[1]: Failed to start MariaDB database
server.
Oct 15 19:27:52 spaceman systemd[1]: Unit mariadb@bootstrap.service
entered failed state.
Oct 15 19:27:52 spaceman systemd[1]: mariadb@bootstrap.service failed.
2015-11-02 23:37:03 -05:00
Daniel Black
3723c70a30 MDEV-426: systemd PermissionsStartOnly=true by default
mariadb-service-convert during migration can create a file containing
ExecStartPre=/usr/sbin/sysctl -q -w vm.drop_caches=3 if the users my.cnf
contains [mysqld_safe] flush_caches. This sysctl entry change requires root
access. No existing ExecStartPre requires execution requires execution
as another user.

There is a comment in the mariadb{,@}.service.in that indicates
mysqld_install which would require -u mysql to explicity change user to
mysql from root since PermissionsStartOnly=true.

Otherwise the following error would be generated:
Oct 14 07:38:38 spaceman systemd[1]: Starting MariaDB database server...
-- Subject: Unit mariadb.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mariadb.service has begun starting up.
Oct 14 07:38:38 spaceman sysctl[10089]: sysctl: permission denied on key 'vm.drop_caches'
Oct 14 07:38:38 spaceman systemd[1]: mariadb.service: control process exited, code=exited status=255
Oct 14 07:38:38 spaceman systemd[1]: Failed to start MariaDB database server.
2015-10-14 12:45:59 +02:00
Sergey Vojtovich
6346d1de2f MDEV-427/MDEV-5713 Add systemd script with notify functionality
After review/QA fixes.
2015-10-12 17:51:49 +02:00
Renamed from support-files/mariadb.service (Browse further)