1 From bf66e7d610de0d7d3651742342c01ed9ff93f363 Mon Sep 17 00:00:00 2001
2 From: Christian Hesse <mail@eworm.de>
3 Date: Wed, 19 Feb 2020 13:10:17 +0100
4 Subject: [PATCH 1/3] enable PrivateTmp for a little bit more security
6 support-files/mariadb.service.in | 2 +-
7 support-files/mariadb@.service.in | 2 +-
8 2 files changed, 2 insertions(+), 2 deletions(-)
10 diff --git a/support-files/mariadb.service.in b/support-files/mariadb.service.in
11 index e7665ed1219..a1fe69d61c4 100644
12 --- a/support-files/mariadb.service.in
13 +++ b/support-files/mariadb.service.in
14 @@ -129,7 +129,7 @@ UMask=007
16 # If you don't use the /tmp directory for SELECT ... OUTFILE and
17 # LOAD DATA INFILE you can enable PrivateTmp=true for a little more security.
21 # Set an explicit Start and Stop timeout of 900 seconds (15 minutes!)
22 # this is the same value as used in SysV init scripts in the past
23 diff --git a/support-files/mariadb@.service.in b/support-files/mariadb@.service.in
24 index ffefc2f22d8..f8b0b8aad8d 100644
25 --- a/support-files/mariadb@.service.in
26 +++ b/support-files/mariadb@.service.in
27 @@ -241,7 +241,7 @@ UMask=007
29 # If you don't use the /tmp directory for SELECT ... OUTFILE and
30 # LOAD DATA INFILE you can enable PrivateTmp=true for a little more security.
34 # Set an explicit Start and Stop timeout of 900 seconds (15 minutes!)
35 # this is the same value as used in SysV init scripts in the past
37 From 00aab78891a19a14a92039fcc6a73e391a3bb471 Mon Sep 17 00:00:00 2001
38 From: Christian Hesse <mail@eworm.de>
39 Date: Wed, 19 Feb 2020 13:10:46 +0100
40 Subject: [PATCH 2/3] force preloading jemalloc for memory management
42 support-files/mariadb.service.in | 1 +
43 support-files/mariadb@.service.in | 1 +
44 2 files changed, 2 insertions(+)
46 diff --git a/support-files/mariadb.service.in b/support-files/mariadb.service.in
47 index a1fe69d61c4..9a2941ae917 100644
48 --- a/support-files/mariadb.service.in
49 +++ b/support-files/mariadb.service.in
50 @@ -159,6 +159,7 @@ LimitNOFILE=16364
51 # Library substitutions. previously [mysqld_safe] malloc-lib with explicit paths
52 # (in LD_LIBRARY_PATH) and library name (in LD_PRELOAD).
53 # Environment="LD_LIBRARY_PATH=/path1 /path2" "LD_PRELOAD=
54 +Environment="LD_PRELOAD=/usr/lib/libjemalloc.so"
56 # Flush caches. previously [mysqld_safe] flush-caches=1
58 diff --git a/support-files/mariadb@.service.in b/support-files/mariadb@.service.in
59 index f8b0b8aad8d..3309127330c 100644
60 --- a/support-files/mariadb@.service.in
61 +++ b/support-files/mariadb@.service.in
62 @@ -282,6 +282,7 @@ LimitNOFILE=16364
63 # Library substitutions. previously [mysqld_safe] malloc-lib with explicit paths
64 # (in LD_LIBRARY_PATH) and library name (in LD_PRELOAD).
65 # Environment="LD_LIBRARY_PATH=/path1 /path2" "LD_PRELOAD=
66 +Environment="LD_PRELOAD=/usr/lib/libjemalloc.so"
68 # Flush caches. previously [mysqld_safe] flush-caches=1
71 From a78ff18c83a5eb2556d4f3716f13786dcd8395d2 Mon Sep 17 00:00:00 2001
72 From: Christian Hesse <mail@eworm.de>
73 Date: Wed, 19 Feb 2020 13:11:31 +0100
74 Subject: [PATCH 3/3] Make systemd-tmpfiles create MYSQL_DATADIR
76 This is a no-op if the directory exists, but makes sure it is created by
77 systemd-tmpfiles with proper permissions otherwise.
79 This solves packaging issues when the user MYSQLD_USER is created by
80 systemd-sysusers and uid is not known in advance.
82 Also this now sets the No_COW attribute.
84 support-files/tmpfiles.conf.in | 2 +
85 1 file changed, 2 insertion(+)
87 diff --git a/support-files/tmpfiles.conf.in b/support-files/tmpfiles.conf.in
88 index 03d66abc0c7..3c89cb258c9 100644
89 --- a/support-files/tmpfiles.conf.in
90 +++ b/support-files/tmpfiles.conf.in
92 d @MYSQL_UNIX_DIR@ 0755 @MYSQLD_USER@ @MYSQLD_USER@ -
93 +d @MYSQL_DATADIR@ 0700 @MYSQLD_USER@ @MYSQLD_USER@ -
94 +h @MYSQL_DATADIR@ - - - - +C