diff options
Diffstat (limited to 'support-files')
-rw-r--r-- | support-files/CMakeLists.txt | 9 | ||||
-rwxr-xr-x | support-files/build-tags | 2 | ||||
-rw-r--r-- | support-files/ccfilter | 33 | ||||
-rw-r--r-- | support-files/compiler_warnings.supp | 220 | ||||
-rw-r--r-- | support-files/mariadb.service.in | 28 | ||||
-rw-r--r-- | support-files/mariadb@.service.in | 39 | ||||
-rw-r--r-- | support-files/my-huge.cnf.sh | 1 | ||||
-rw-r--r-- | support-files/my-innodb-heavy-4G.cnf.sh | 7 | ||||
-rw-r--r-- | support-files/my-large.cnf.sh | 1 | ||||
-rw-r--r-- | support-files/my-medium.cnf.sh | 1 | ||||
-rw-r--r-- | support-files/my-small.cnf.sh | 1 | ||||
-rw-r--r-- | support-files/mysql.server.sh | 12 | ||||
-rw-r--r-- | support-files/policy/apparmor/usr.sbin.mysqld | 2 | ||||
-rw-r--r-- | support-files/rpm/plugin-postin.sh | 3 | ||||
-rw-r--r-- | support-files/rpm/server-posttrans.sh | 10 | ||||
-rw-r--r-- | support-files/rpm/server-postun.sh | 10 | ||||
-rw-r--r-- | support-files/rpm/server-prein.sh | 2 | ||||
-rw-r--r-- | support-files/rpm/server.cnf | 4 | ||||
-rw-r--r-- | support-files/use_galera_new_cluster.conf | 3 |
19 files changed, 229 insertions, 159 deletions
diff --git a/support-files/CMakeLists.txt b/support-files/CMakeLists.txt index 62ad8bcffc9..6ab84b59b29 100644 --- a/support-files/CMakeLists.txt +++ b/support-files/CMakeLists.txt @@ -87,6 +87,15 @@ IF(UNIX) ADD_CUSTOM_TARGET(${pol}-pp ALL DEPENDS ${out}) INSTALL(FILES ${out} DESTINATION ${inst_location}/policy/selinux COMPONENT SupportFiles) ENDFOREACH() + IF(RPM) + EXECUTE_PROCESS(COMMAND rpm -q --qf "%{VERSION}-%{RELEASE}" libsepol + OUTPUT_VARIABLE LIBSEPOL_VERSION RESULT_VARIABLE err) + IF (NOT err) + SET(CPACK_RPM_server_PACKAGE_REQUIRES + "${CPACK_RPM_server_PACKAGE_REQUIRES} libsepol >= ${LIBSEPOL_VERSION}" + PARENT_SCOPE) + ENDIF() + ENDIF() ENDIF() ENDIF() diff --git a/support-files/build-tags b/support-files/build-tags index 03b243ee8cc..e94b7bed298 100755 --- a/support-files/build-tags +++ b/support-files/build-tags @@ -8,7 +8,7 @@ then echo client storage dbug libmysql sql-common \ sql extra mysys mysys_ssl strings regex pcre vio include \ tools unittest plugin libmysqld | \ - xargs -n1 git ls-files | grep -v '\.jar$' | \ + xargs -n1 git ls-files | grep -v '\.jar$' | grep -v '\.xz$' | \ xargs etags -o TAGS --append else find . -type f ! -name "*.jar" | diff --git a/support-files/ccfilter b/support-files/ccfilter index e2957cd3228..4e2c6f57836 100644 --- a/support-files/ccfilter +++ b/support-files/ccfilter @@ -7,14 +7,20 @@ # # Use by setting CC="ccfilter gcc" CXX="ccfilter gcc" before ./configure. # +# When testing from command line, you can run it as +# perl ccfilter cat logfile > /dev/null +# to see the errors that are not filtered +# # By default, just filters the output for suppressed warnings. If the # FAILONWARNING environment variable is set, then instead will fail the # compile on encountering a non-suppressed warnings. + use strict; use warnings; my $suppressions; +my $filter_stderr= $ARGV[0] ne "cat"; open STDOUT_COPY, ">&STDOUT" or die "Failed to dup stdout: $!]n"; @@ -27,11 +33,14 @@ if (!defined($pid)) { # Child. # actually want to send the STDERR to the parent, not the STDOUT. # So shuffle things around a bit. - open STDERR, ">&STDOUT" - or die "Child: Failed to dup pipe to parent: $!\n"; - open STDOUT, ">&STDOUT_COPY" - or die "Child: Failed to dup parent stdout: $!\n"; - close STDOUT_COPY; + if ($filter_stderr) + { + open STDERR, ">&STDOUT" + or die "Child: Failed to dup pipe to parent: $!\n"; + open STDOUT, ">&STDOUT_COPY" + or die "Child: Failed to dup parent stdout: $!\n"; + close STDOUT_COPY; + } exec { $ARGV[0] } @ARGV; die "Child: exec() failed: $!\n"; } else { @@ -41,9 +50,9 @@ if (!defined($pid)) { chomp($cwd); while (<PIPE>) { my $line= $_; - if (/^(.*?):([0-9]+): [Ww]arning: (.*)$/) { + if (/^(.*?):([0-9]+):(?:[0-9]+:)? [Ww]arning: (.*)$/) { my ($file, $lineno, $msg)= ($1, $2, $3); - $file= "$cwd/$file"; + $file= "$cwd/$file" if (length($file) > 0 && substr($file,0,1) ne "/"); next if check_if_suppressed($file, $lineno, $msg); @@ -52,8 +61,14 @@ if (!defined($pid)) { print STDERR $line; next; } - - print STDERR $line; + if ($filter_stderr) + { + print STDERR $line; + } + else + { + print STDOUT $line; + } } close(PIPE); } diff --git a/support-files/compiler_warnings.supp b/support-files/compiler_warnings.supp index 44f122d9473..249060108bf 100644 --- a/support-files/compiler_warnings.supp +++ b/support-files/compiler_warnings.supp @@ -3,61 +3,61 @@ # be ignored for various reasons. # -integer.cpp: .*control reaches end of non-void function.*: 1288-1427 -integer.cpp: .*no return statement in function returning non-void.*: 1288-1427 -DictTabInfo.cpp : .*invalid access to non-static.* -DictTabInfo.cpp : .*macro was used incorrectly.* -DbdihMain.cpp : .*unused variable.* : 6666-7013 -DbtupExecQuery.cpp : .*unused variable.* : 1823 -kernel_types.h : .*only defines private constructors and has no friends.* : 51 -Dbtup.hpp: .*only defines private constructors and has no friends.* -diskpage.hpp: .*only defines private constructors and has no friends.* -tuppage.hpp: .*only defines private constructors and has no friends.* -sql_yacc.cc : .*label 'yyerrlab1' defined but not used.* -kernel_types.h : .*'struct Local_key' only defines private constructors and has no friends.* -lgman.hpp : .*'struct Lgman::Buffer_idx' only defines private constructors and has no friends.* -SchemaFile.hpp : .*'struct SchemaFile::TableEntry' only defines private constructors and has no friends.* -sql_yacc.cc : .*switch statement contains 'default' but no 'case' labels.* +.*/integer.cpp: .*control reaches end of non-void function.*: 1288-1427 +.*/integer.cpp: .*no return statement in function returning non-void.*: 1288-1427 +.*/DictTabInfo.cpp : .*invalid access to non-static.* +.*/DictTabInfo.cpp : .*macro was used incorrectly.* +.*/DbdihMain.cpp : .*unused variable.* : 6666-7013 +.*/DbtupExecQuery.cpp : .*unused variable.* : 1823 +.*/kernel_types.h : .*only defines private constructors and has no friends.* : 51 +.*/Dbtup.hpp: .*only defines private constructors and has no friends.* +.*/diskpage.hpp: .*only defines private constructors and has no friends.* +.*/tuppage.hpp: .*only defines private constructors and has no friends.* +.*/sql_yacc.cc : .*label 'yyerrlab1' defined but not used.* +.*/kernel_types.h : .*'struct Local_key' only defines private constructors and has no friends.* +.*/lgman.hpp : .*'struct Lgman::Buffer_idx' only defines private constructors and has no friends.* +.*/SchemaFile.hpp : .*'struct SchemaFile::TableEntry' only defines private constructors and has no friends.* +.*/sql_yacc.cc : .*switch statement contains 'default' but no 'case' labels.* # # Things that can be ignored in InnoDB # -pars0grm.tab.c: .*'yyerrorlab' : unreferenced label.* -pars0grm.c: 'yyerrorlab' : unreferenced label -_flex_tmp.c: .*not enough actual parameters for macro 'yywrap'.* -lexyy.c : not enough actual parameters for macro 'yywrap' -pars0lex.l: .*conversion from 'ulint' to 'int', possible loss of data.* -include/buf0buf\.ic: unused parameter .*mtr.* -fil/fil0fil\.c: pointer targets in passing argument.*differ in signedness -fil/fil0fil\.c: comparison between signed and unsigned : 3100-3199 -fil/fil0fil\.c: unused parameter -log/log0recv\.c: unused variable -os/os0file\.c: unused parameter -os/os0file\.c: pointer targets in assignment differ in signedness -handler/i_s\.cc: unused variable -sync/sync0rw\.c: unused parameter -sync/sync0sync\.c: unused parameter -sync/sync0sync\.c: unused variable -ut/ut0ut\.c: ignoring return value of -srv/srv0srv\.c: value computed is not used -buf/buf0buf\.c: .*block_mutex.* might be used uninitialized -btr/btr0cur\.c: null argument where non-null required: 1800-3000 -btr/btr0btr\.c: null argument where non-null required -btr/btr0cur\.c: .*value computed is not used.*: 3175-3375 -btr/btr0sea\.c: passing argument 2 .* discards qualifiers from pointer target type -ibuf/ibuf0ibuf.c: null argument where non-null required: 700-1000 -fsp0fsp\.c: result of 32-bit shift implicitly converted to 64 bits -log/log0log\.c : passing arg 1 of `atomic_add_64_nv' from incompatible pointer type -log/log0online\.c : passing arg 1 of `atomic_add_64_nv' from incompatible pointer type -buf/buf0buf\.c : label.*loop2.* defined but not used +.*/pars0grm.tab.c: .*'yyerrorlab' : unreferenced label.* +.*/pars0grm.c: 'yyerrorlab' : unreferenced label +.*/_flex_tmp.c: .*not enough actual parameters for macro 'yywrap'.* +.*/lexyy.c : not enough actual parameters for macro 'yywrap' +.*/pars0lex.l: .*conversion from 'ulint' to 'int', possible loss of data.* +.*/include/buf0buf\.ic: unused parameter .*mtr.* +.*/fil/fil0fil\.c: pointer targets in passing argument.*differ in signedness +.*/fil/fil0fil\.c: comparison between signed and unsigned : 3100-3199 +.*/fil/fil0fil\.c: unused parameter +.*/log/log0recv\.c: unused variable +.*/os/os0file\.c: unused parameter +.*/os/os0file\.c: pointer targets in assignment differ in signedness +.*/handler/i_s\.cc: unused variable +.*/sync/sync0rw\.c: unused parameter +.*/sync/sync0sync\.c: unused parameter +.*/sync/sync0sync\.c: unused variable +.*/ut/ut0ut\.c: ignoring return value of +.*/srv/srv0srv\.c: value computed is not used +.*/buf/buf0buf\.c: .*block_mutex.* might be used uninitialized +.*/btr/btr0cur\.c: null argument where non-null required: 1800-3000 +.*/btr/btr0btr\.c: null argument where non-null required +.*/btr/btr0cur\.c: .*value computed is not used.*: 3175-3375 +.*/btr/btr0sea\.c: passing argument 2 .* discards qualifiers from pointer target type +.*/ibuf/ibuf0ibuf.c: null argument where non-null required: 700-1000 +.*/fsp0fsp\.c: result of 32-bit shift implicitly converted to 64 bits +.*/log/log0log\.c : passing arg 1 of `atomic_add_64_nv' from incompatible pointer type +.*/log/log0online\.c : passing arg 1 of `atomic_add_64_nv' from incompatible pointer type +.*/buf/buf0buf\.c : label.*loop2.* defined but not used # # Xtradb engine # -storage/xtradb/handler/ha_innodb\.cc: ignoring return value of -storage/xtradb/row/row0log\.cc: ignoring return value of -storage/xtradb/btr/btr0cur\.cc : null argument where non-null required -storage/xtradb/btr/btr0scrub\.cc : null argument where non-null required +.*/storage/xtradb/handler/ha_innodb\.cc: ignoring return value of +.*/storage/xtradb/row/row0log\.cc: ignoring return value of +.*/storage/xtradb/btr/btr0cur\.cc : null argument where non-null required +.*/storage/xtradb/btr/btr0scrub\.cc : null argument where non-null required # # bdb is not critical to keep up to date @@ -66,29 +66,29 @@ storage/xtradb/btr/btr0scrub\.cc : null argument where non-null required .*/bdb/.* : .*unused parameter.* .*/bdb/.* : .*may be used uninitialized.* .*/bdb/.* : .*empty body in an if-statement.* -db_vrfy.c : .*comparison is always false due to limited range of data type.* +.*/db_vrfy.c : .*comparison is always false due to limited range of data type.* # # readline is not maintained by us # .*/cmd-line-utils/readline/.* : .* -readline\.c : unused parameter -term\.c : unused parameter -vi\.c : unused parameter -common\.c : unused parameter -term\.c : .* +.*/readline\.c : unused parameter +.*/term\.c : unused parameter +.*/vi\.c : unused parameter +.*/common\.c : unused parameter +.*/term\.c : .* # # Ignore some warnings in libevent, which is not maintained by us. # .*/extra/libevent/.* : .*unused parameter.* .*/extra/libevent/select\.c : .*comparison between signed and unsigned.* : 270-280 -signal\.c : .*unused parameter.* +.*/signal\.c : .*unused parameter.* # # Ignore warnings from system libraries # -/usr/share/aclocal/audiofile.m4 : .* +.*/aclocal/audiofile.m4 : .* # # Ignore strict-aliasing warnings (for now) @@ -131,30 +131,30 @@ signal\.c : .*unused parameter.* # # Aria warning that is ok in debug builds # -storage/maria/ma_pagecache.c: .*'info_check_pin' defined but not used +.*/storage/maria/ma_pagecache.c: .*'info_check_pin' defined but not used # # oqgraph errors that are hard to fix # -oqgraph/graphcore\.cc : may be used uninitialized in this function +.*/oqgraph/graphcore\.cc : may be used uninitialized in this function # # Yassl # -include/runtime.hpp: .*pure_error.* +.*/include/runtime.hpp: .*pure_error.* .*/extra/yassl/.*taocrypt/.*: comparison with string literal .*/extra/yassl/taocrypt/src/blowfish\.cpp: array subscript is above array bounds .*/extra/yassl/taocrypt/src/file\.cpp: ignoring return value .*/extra/yassl/taocrypt/src/integer\.cpp: control reaches end of non-void function -mySTL/algorithm\.hpp: is used uninitialized in this function -include/pwdbased\.hpp: comparison of unsigned expression +.*/mySTL/algorithm\.hpp: is used uninitialized in this function +.*/include/pwdbased\.hpp: comparison of unsigned expression # # OpenSSL # # The following comes because of different prototype between yassl and openssl. # Save as the argument is a function within the library. -vio/viosslfactories\.c: discards ~const~ qualifier from pointer target type +.*/vio/viosslfactories\.c: discards ~const~ qualifier from pointer target type # # Groff warnings on OpenSUSE. @@ -166,83 +166,105 @@ vio/viosslfactories\.c: discards ~const~ qualifier from pointer target type # Warnings on OpenSolaris # .*/my_config\.h : _FILE_OFFSET_BITS -/usr/include/sys/feature_tests.h : this is the location of the previous definition -.*auth_pam\.c : initialization from incompatible pointer type : 100-200 +.*/include/sys/feature_tests.h : this is the location of the previous definition +.*/auth_pam\.c : initialization from incompatible pointer type : 100-200 +.*/mysys/my_lock\.c : incompatible pointer # # jemalloc # -jemalloc/src/jemalloc\.c: always_inline function might not be inlinable -jemalloc/src/jemalloc\.c: set but not used +.*/jemalloc/src/jemalloc\.c: always_inline function might not be inlinable +.*/jemalloc/src/jemalloc\.c: set but not used # # Connect engine # -storage/connect/ha_connect\.cc: might be clobbered by .*longjmp -storage/connect/connect\.cc: might be clobbered by .*longjmp -storage/connect/filamvct\.cpp: ignoring return value of -storage/connect/filamvct\.cpp: might be clobbered by .*longjmp -storage/connect/xindex\.cpp: ignoring return value of -storage/connect/value\.cpp: always false +.*/storage/connect/ha_connect\.cc: might be clobbered by.*longjmp +.*/storage/connect/connect\.cc: might be clobbered by.*longjmp +.*/storage/connect/filamvct\.cpp: ignoring return value of +.*/storage/connect/filamvct\.cpp: might be clobbered by +.*/storage/connect/xindex\.cpp: ignoring return value of +.*/storage/connect/value\.cpp: always false : 1000-1020 +.*/storage/connect/json\.cpp: might be clobbered by # # mroonga # -groonga/lib/expr\.c: propagation disabled -groonga/lib/expr\.c: PRE disabled -groonga/lib/expr\.c: always false +.*/groonga/lib/expr\.c : GCSE disabled +.*/groonga/lib/expr\.c : NULL pointer checks disabled +.*/groonga/lib/expr\.c : PRE disabled +.*/groonga/lib/expr\.c : always false +.*/groonga/lib/expr\.c : jump bypassing disabled +.*/groonga/lib/expr\.c : propagation disabled +.*/groonga/lib/nfkc\.c : GCSE disabled +.*/groonga/lib/nfkc\.c : NULL pointer checks disabled +.*/groonga/lib/nfkc\.c : jump bypassing disabled +.*/groonga/lib/str\.c : comparing floating point +.*/groonga/lib/db\.c : missing initializer +.*/groonga/lib/ii\.c : missing initializer +.*/groonga/lib/normalizer\.c : missing initializer +.*/groonga/lib/proc\.c : missing initializer +.*/groonga/lib/tokenizer\.c : missing initializer # -# Mroonga +# TokuDB # -groonga/lib/expr\.c : const/copy propagation disabled + +# This one is marked with __attribute__, but we still get a (wrong) warning +.*/liblzma/lz/lz_encoder\.c : variable.*in_used.*set but not used # # Unexplanable (?) stuff # -listener\.cc : .*conversion from 'SOCKET' to 'int'.* -net_serv\.cc : .*conversion from 'SOCKET' to 'int'.* +.*/listener\.cc : .*conversion from 'SOCKET' to 'int'.* +.*/net_serv\.cc : .*conversion from 'SOCKET' to 'int'.* # # Ignorable warnings from header files # -backward_warning\.h : This file includes at least one +.*/backward_warning\.h : This file includes at least one /usr/include/i386-linux-gnu/bits/string3\.h: memset used with constant zero length parameter -bits/string3.h : might overflow destination buffer +.*/bits/string3.h : might overflow destination buffer # allow a little moving space for the warning below -mi_packrec\.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 560-600 -ma_packrec\.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 550-650 +.*/mi_packrec\.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 560-600 +.*/ma_packrec\.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 550-650 # # Wrong compiler warnings # .* : .*no matching operator delete found; memory will not be freed if initialization throws an exception.* -ctype-simple\.c : .*unary minus operator applied to unsigned type, result still unsigned.* -sql/sys_vars\.cc : invalid access to non-static data member -string3\.h : memset used with constant zero length parameter +.*/ctype-simple\.c : .*unary minus operator applied to unsigned type, result still unsigned.* +.*/sql/sys_vars\.cc : invalid access to non-static data member +.*/string3\.h : memset used with constant zero length parameter +.*/sql/wsrep_hton\.cc : NULL used in arithmetic : 500-600 +.* : missing-declarations.*is valid # # Ignorable errors on mac # -my_aes\.c: deprecated -my_sha1\.cc: deprecated -my_md5\.cc: deprecated -my_rnd\.cc: deprecated -mdl\.cc: invalid access -mdl\.cc: offsetoff +.*/my_aes\.c: deprecated +.*/my_sha1\.cc: deprecated +.*/my_md5\.cc: deprecated +.*/my_rnd\.cc: deprecated +.*/mdl\.cc: invalid access +.*/mdl\.cc: offsetoff # Wrong warning due to GCC bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29478 -regexec\.c : passing argument 3 of.*matcher.* discards qualifiers from pointer target type -libmysql\.c: passing argument 2 of .*memcpy.* discards qualifiers from pointer target type : 3000-4000 -storage/.*/dict/dict0dict\.c : passing argument 1 of .*strcpy.* discards qualifiers from pointer target type : 2500-3500 -storage/.*/sync/sync0rw\.c : passing argument 1 of .*memset.* discards qualifiers from pointer target type : 200-300 -storage/.*/btr/btr0sea\.c : passing argument 2 of .*btr_cur_position.* discards qualifiers from pointer +.*/regexec\.c : passing argument 3 of.*matcher.* discards qualifiers from pointer target type +.*/libmysql\.c: passing argument 2 of .*memcpy.* discards qualifiers from pointer target type : 3000-4000 +.*/storage/.*/dict/dict0dict\.c : passing argument 1 of .*strcpy.* discards qualifiers from pointer target type : 2500-3500 +.*/storage/.*/sync/sync0rw\.c : passing argument 1 of .*memset.* discards qualifiers from pointer target type : 200-300 +.*/storage/.*/btr/btr0sea\.c : passing argument 2 of .*btr_cur_position.* discards qualifiers from pointer + +# Fixed wrong warning in GCC due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61520 +.*/strings/decimal\.c : array subscript is .* array bounds # # Strange things from autoconf that is probably safe to ignore # -configure.in : warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body -configure.in : config/ac-macros/character_sets.m4.*prefer named diversions -warning: File listed twice +.*configure.in : warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body +.*configure.in : config/ac-macros/character_sets.m4.*prefer named diversions warning: File listed twice +.*/include/mysql/client_plugin\.h : _mysql_client_plugin_declaration_ +.*/plugin/auth_gssapi/client_plugin\.cc: _mysql_client_plugin_declaration_ diff --git a/support-files/mariadb.service.in b/support-files/mariadb.service.in index ede97c04112..1fc2527322c 100644 --- a/support-files/mariadb.service.in +++ b/support-files/mariadb.service.in @@ -1,23 +1,28 @@ +# It's not recommended to modify this file in-place, because it will be +# overwritten during package upgrades. If you want to customize, the +# best way is to create a file "/etc/systemd/system/mariadb.service", +# containing +# .include /usr/lib/systemd/system/mariadb.service +# ...make your changes here... +# or create a file "/etc/systemd/system/mariadb.service.d/foo.conf", +# which doesn't need to include ".include" call and which will be parsed +# after the file mariadb.service itself is parsed. # -# /etc/systemd/system/mariadb.service +# For more info about custom unit files, see systemd.unit(5) or +# https://mariadb.com/kb/en/mariadb/systemd/ +# +# Copyright notice: # # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. -# -# Thanks to: -# Daniel Black -# Erkan Yanar -# David Strauss -# and probably others [Unit] Description=MariaDB @VERSION@ database server Documentation=man:mysqld(8) Documentation=https://mariadb.com/kb/en/library/systemd/ After=network.target -After=syslog.target [Install] WantedBy=multi-user.target @@ -81,12 +86,15 @@ ExecStartPre=/bin/sh -c "[ ! -e @bindir@/galera_recovery ] && VAR= || \ # Use the [Service] section and Environment="MYSQLD_OPTS=...". # This isn't a replacement for my.cnf. # _WSREP_NEW_CLUSTER is for the exclusive use of the script galera_new_cluster -ExecStart=@sbindir@/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION -@SYSTEMD_EXECSTARTPOST@ +# Note: we set --basedir to prevent probes that might trigger SELinux alarms, +# per bug https://bugzilla.redhat.com/show_bug.cgi?id=547485 +ExecStart=@sbindir@/mysqld $MYSQLD_OPTS --basedir=@prefix@ $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION # Unset _WSREP_START_POSITION environment variable. ExecStartPost=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION" +@SYSTEMD_EXECSTARTPOST@ + KillSignal=SIGTERM # Don't want to see an automated SIGKILL ever diff --git a/support-files/mariadb@.service.in b/support-files/mariadb@.service.in index 1f84b582e4e..15d640a2c7e 100644 --- a/support-files/mariadb@.service.in +++ b/support-files/mariadb@.service.in @@ -1,29 +1,35 @@ # Multi instance version of mariadb. For if you run multiple versions at once. -# Also used for mariadb@bootstrap to tell you to use galera_new_cluster. # -# create config file @sysconf2dir@/my{instancename}.cnf +# create config file @sysconf2dir@/my{instancename}.cnf to be used as the +# configuration file for this service. # # start as systemctl start mariadb@{instancename}.server - +# +# It's not recommended to modify this file in-place, because it will be +# overwritten during package upgrades. If you want to customize, the +# best way is to create a file "/etc/systemd/system/mariadb@.service", +# containing +# .include /usr/lib/systemd/system/mariadb@.service +# ...make your changes here... +# or create a file "/etc/systemd/system/mariadb@.service.d/foo.conf", +# which doesn't need to include ".include" call and which will be parsed +# after the file mariadb@.service itself is parsed. +# +# For more info about custom unit files, see systemd.unit(5) or +# https://mariadb.com/kb/en/mariadb/systemd/ +# +# Copyright notice: +# # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. -# -# Thanks to: -# Daniel Black -# Erkan Yanar -# David Strauss -# and probably others -# Inspired from https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-db/mysql-init-scripts/files/mysqld_at.service [Unit] Description=MariaDB @VERSION@ database server (multi-instance %I) Documentation=man:mysqld(8) Documentation=https://mariadb.com/kb/en/library/systemd/ After=network.target -After=syslog.target - ConditionPathExists=@sysconf2dir@/my%I.cnf [Install] @@ -68,6 +74,8 @@ ProtectHome=true # Execute pre and post scripts as root, otherwise it does it as User= PermissionsStartOnly=true +@SYSTEMD_EXECSTARTPRE@ + # Perform automatic wsrep recovery. When server is started without wsrep, # galera_recovery simply returns an empty string. In any case, however, # the script is not expected to return with a non-zero status. @@ -95,9 +103,12 @@ ExecStartPre=/bin/sh -c "[ ! -e @bindir@/galera_recovery ] && VAR= || \ # This isn't a replacement for my.cnf. # _WSREP_NEW_CLUSTER is for the exclusive use of the script galera_new_cluster +# Note: we set --basedir to prevent probes that might trigger SELinux alarms, +# per bug https://bugzilla.redhat.com/show_bug.cgi?id=547485 +# # Note: Place $MYSQLD_OPTS at the very end for its options to take precedence. -ExecStart=@sbindir@/mysqld --defaults-file=@sysconf2dir@/my%I.cnf \ +ExecStart=@sbindir@/mysqld --defaults-file=@sysconf2dir@/my%I.cnf --basedir=@prefix@ \ $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION%I $MYSQLD_OPTS # Alternate: (remove ConditionPathExists above) # use [mysqld.INSTANCENAME] as sections in my.cnf @@ -108,6 +119,8 @@ ExecStart=@sbindir@/mysqld --defaults-file=@sysconf2dir@/my%I.cnf \ # Unset _WSREP_START_POSITION environment variable. ExecStartPost=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION%I" +@SYSTEMD_EXECSTARTPOST@ + KillSignal=SIGTERM # Don't want to see an automated SIGKILL ever diff --git a/support-files/my-huge.cnf.sh b/support-files/my-huge.cnf.sh index 4e083488285..597e66f2099 100644 --- a/support-files/my-huge.cnf.sh +++ b/support-files/my-huge.cnf.sh @@ -125,7 +125,6 @@ server-id = 1 # You can set .._buffer_pool_size up to 50 - 80 % # of RAM but beware of setting memory usage too high #innodb_buffer_pool_size = 384M -#innodb_additional_mem_pool_size = 20M # Set .._log_file_size to 25 % of buffer pool size #innodb_log_file_size = 100M #innodb_log_buffer_size = 8M diff --git a/support-files/my-innodb-heavy-4G.cnf.sh b/support-files/my-innodb-heavy-4G.cnf.sh index 2590ff5ddea..bf9ec7fa147 100644 --- a/support-files/my-innodb-heavy-4G.cnf.sh +++ b/support-files/my-innodb-heavy-4G.cnf.sh @@ -356,13 +356,6 @@ myisam_recover # and speed up some things. #skip-innodb -# Additional memory pool that is used by InnoDB to store metadata -# information. If InnoDB requires more memory for this purpose it will -# start to allocate it from the OS. As this is fast enough on most -# recent operating systems, you normally do not need to change this -# value. SHOW INNODB STATUS will display the current amount used. -innodb_additional_mem_pool_size = 16M - # InnoDB, unlike MyISAM, uses a buffer pool to cache both indexes and # row data. The bigger you set this the less disk I/O is needed to # access data in tables. On a dedicated database server you may set this diff --git a/support-files/my-large.cnf.sh b/support-files/my-large.cnf.sh index 6f8dab0b0e2..50f62e897ea 100644 --- a/support-files/my-large.cnf.sh +++ b/support-files/my-large.cnf.sh @@ -125,7 +125,6 @@ server-id = 1 # You can set .._buffer_pool_size up to 50 - 80 % # of RAM but beware of setting memory usage too high #innodb_buffer_pool_size = 256M -#innodb_additional_mem_pool_size = 20M # Set .._log_file_size to 25 % of buffer pool size #innodb_log_file_size = 64M #innodb_log_buffer_size = 8M diff --git a/support-files/my-medium.cnf.sh b/support-files/my-medium.cnf.sh index 19ab8dfb151..77d60b5d724 100644 --- a/support-files/my-medium.cnf.sh +++ b/support-files/my-medium.cnf.sh @@ -123,7 +123,6 @@ server-id = 1 # You can set .._buffer_pool_size up to 50 - 80 % # of RAM but beware of setting memory usage too high #innodb_buffer_pool_size = 16M -#innodb_additional_mem_pool_size = 2M # Set .._log_file_size to 25 % of buffer pool size #innodb_log_file_size = 5M #innodb_log_buffer_size = 8M diff --git a/support-files/my-small.cnf.sh b/support-files/my-small.cnf.sh index 8c78072c0a7..511a48627fd 100644 --- a/support-files/my-small.cnf.sh +++ b/support-files/my-small.cnf.sh @@ -65,7 +65,6 @@ server-id = 1 # You can set .._buffer_pool_size up to 50 - 80 % # of RAM but beware of setting memory usage too high #innodb_buffer_pool_size = 16M -#innodb_additional_mem_pool_size = 2M # Set .._log_file_size to 25 % of buffer pool size #innodb_log_file_size = 5M #innodb_log_buffer_size = 8M diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh index f3620d388c4..6eb2d0bc257 100644 --- a/support-files/mysql.server.sh +++ b/support-files/mysql.server.sh @@ -46,8 +46,8 @@ basedir= datadir= # Default value, in seconds, afterwhich the script should timeout waiting -# for server start. -# Value here is overridden by value in my.cnf. +# for server start. +# Value here is overridden by value in my.cnf. # 0 means don't wait at all # Negative numbers mean to wait indefinitely service_startup_timeout=900 @@ -377,7 +377,7 @@ case "$mode" in ;; 'status') # First, check to see if pid file exists - if test -s "$mysqld_pid_file_path" ; then + if test -s "$mysqld_pid_file_path" ; then read mysqld_pid < "$mysqld_pid_file_path" if su_kill -0 $mysqld_pid ; then log_success_msg "MariaDB running ($mysqld_pid)" @@ -395,11 +395,11 @@ case "$mode" in if test $pid_count -gt 1 ; then log_failure_msg "Multiple MariaDB running but PID file could not be found ($mysqld_pid)" exit 5 - elif test -z $mysqld_pid ; then - if test -f "$lock_file_path" ; then + elif test -z $mysqld_pid ; then + if test -f "$lock_file_path" ; then log_failure_msg "MariaDB is not running, but lock file ($lock_file_path) exists" exit 2 - fi + fi log_failure_msg "MariaDB is not running" exit 3 else diff --git a/support-files/policy/apparmor/usr.sbin.mysqld b/support-files/policy/apparmor/usr.sbin.mysqld index a362aa78c7a..4b05a58026d 100644 --- a/support-files/policy/apparmor/usr.sbin.mysqld +++ b/support-files/policy/apparmor/usr.sbin.mysqld @@ -34,6 +34,8 @@ /etc/mysql/*.pem r, /etc/mysql/conf.d/ r, /etc/mysql/conf.d/* r, + /etc/mysql/mariadb.conf.d/ r, + /etc/mysql/mariadb.conf.d/* r, /etc/nsswitch.conf r, /etc/passwd r, /etc/services r, diff --git a/support-files/rpm/plugin-postin.sh b/support-files/rpm/plugin-postin.sh new file mode 100644 index 00000000000..1844de1b4f2 --- /dev/null +++ b/support-files/rpm/plugin-postin.sh @@ -0,0 +1,3 @@ +# request the server restart +mkdir -p %{restart_flag_dir} +echo > %{restart_flag} diff --git a/support-files/rpm/server-posttrans.sh b/support-files/rpm/server-posttrans.sh new file mode 100644 index 00000000000..1406c78a5f5 --- /dev/null +++ b/support-files/rpm/server-posttrans.sh @@ -0,0 +1,10 @@ +if [ -r %{restart_flag} ] ; then + rm %{restart_flag} + if [ -x /usr/bin/systemctl ] ; then + /usr/bin/systemctl daemon-reload > /dev/null 2>&1 + /usr/bin/systemctl try-restart mariadb.service > /dev/null 2>&1 + elif %{_sysconfdir}/init.d/mysql status > /dev/null 2>&1; then + # only restart the server if it was alredy running + %{_sysconfdir}/init.d/mysql restart + fi +fi diff --git a/support-files/rpm/server-postun.sh b/support-files/rpm/server-postun.sh index 21468e39e18..27e1125b78f 100644 --- a/support-files/rpm/server-postun.sh +++ b/support-files/rpm/server-postun.sh @@ -1,11 +1,7 @@ if [ $1 -ge 1 ]; then - # only restart the server if it was alredy running - if [ -x /usr/bin/systemctl ] ; then - /usr/bin/systemctl daemon-reload > /dev/null 2>&1 - /usr/bin/systemctl try-restart mariadb.service > /dev/null 2>&1 - elif %{_sysconfdir}/init.d/mysql status > /dev/null 2>&1; then - %{_sysconfdir}/init.d/mysql restart - fi + # request the server restart + mkdir -p %{restart_flag_dir} + echo > %{restart_flag} fi if [ $1 = 0 ] ; then diff --git a/support-files/rpm/server-prein.sh b/support-files/rpm/server-prein.sh index 75f7e7d64cf..9f8d1229bfd 100644 --- a/support-files/rpm/server-prein.sh +++ b/support-files/rpm/server-prein.sh @@ -4,7 +4,7 @@ installed=`rpm -q --whatprovides mysql-server 2> /dev/null` if [ $? -eq 0 -a -n "$installed" ]; then installed=`echo "$installed"|sed -n 1p` - vendor=`rpm -q --queryformat='%{VENDOR}' "$installed" 2>&1` + vendor=`rpm -q --queryformat='%{VENDOR}' "$installed" 2>&1 | sed 's/Monty Program AB/MariaDB Foundation/'` version=`rpm -q --queryformat='%{VERSION}' "$installed" 2>&1` myvendor='%{mysql_vendor}' myversion='%{mysqlversion}' diff --git a/support-files/rpm/server.cnf b/support-files/rpm/server.cnf index 9682d2b836f..3dd39510105 100644 --- a/support-files/rpm/server.cnf +++ b/support-files/rpm/server.cnf @@ -39,8 +39,8 @@ # you can put MariaDB-only options here [mariadb] -# This group is only read by MariaDB-10.1 servers. +# This group is only read by MariaDB-10.2 servers. # If you use the same .cnf file for MariaDB of different versions, # use this group for options that older servers don't understand -[mariadb-10.1] +[mariadb-10.2] diff --git a/support-files/use_galera_new_cluster.conf b/support-files/use_galera_new_cluster.conf index 90e0365ffd8..4d8ad253ce5 100644 --- a/support-files/use_galera_new_cluster.conf +++ b/support-files/use_galera_new_cluster.conf @@ -15,8 +15,11 @@ ConditionPathExists= Type=oneshot Restart=no +ExecStartPre= + # Override the multi instance service for a bootstrap start instance ExecStart= ExecStart=/usr/bin/echo "Please use galera_new_cluster to start the mariadb service with --wsrep-new-cluster" ExecStart=/usr/bin/false +ExecStartPost= |