1 |
commit: c3bf8ff29ade3fd7eba1f1ca98a96d70558b3720 |
2 |
Author: Brian Evans <grknight <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jan 30 02:33:01 2016 +0000 |
4 |
Commit: Brian Evans <grknight <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jan 30 02:33:01 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c3bf8ff2 |
7 |
|
8 |
dev-db/mysql-init-scripts: Version bump to update systemd units wrt bug 572788 |
9 |
|
10 |
dev-db/mariadb has started shipping it's own Notify based units starting with 10.1.8 |
11 |
Set the conflict in mysqld.service to compensate |
12 |
Also, set the binary to be /usr/sbin/mysqld so we are not monitoring a monitor |
13 |
|
14 |
Package-Manager: portage-2.2.27 |
15 |
|
16 |
dev-db/mysql-init-scripts/files/mysqld-v2.service | 27 ++++++++++ |
17 |
.../mysql-init-scripts/files/mysqld_at-v2.service | 26 ++++++++++ |
18 |
.../mysql-init-scripts-2.1_rc1.ebuild | 58 ++++++++++++++++++++++ |
19 |
3 files changed, 111 insertions(+) |
20 |
|
21 |
diff --git a/dev-db/mysql-init-scripts/files/mysqld-v2.service b/dev-db/mysql-init-scripts/files/mysqld-v2.service |
22 |
new file mode 100644 |
23 |
index 0000000..12f7731 |
24 |
--- /dev/null |
25 |
+++ b/dev-db/mysql-init-scripts/files/mysqld-v2.service |
26 |
@@ -0,0 +1,27 @@ |
27 |
+[Unit] |
28 |
+Description=MySQL database server |
29 |
+After=syslog.target |
30 |
+After=network.target |
31 |
+Conflicts=mariadb.service |
32 |
+ |
33 |
+[Service] |
34 |
+Type=simple |
35 |
+User=mysql |
36 |
+Group=mysql |
37 |
+ |
38 |
+# Note: we set --basedir to prevent probes that might trigger SELinux alarms, |
39 |
+# https://bugzilla.redhat.com/show_bug.cgi?id=547485 |
40 |
+ExecStart=/usr/sbin/mysqld --basedir=/usr |
41 |
+ExecStartPost=/usr/libexec/mysqld-wait-ready $MAINPID |
42 |
+ |
43 |
+# Give a reasonable amount of time for the server to start up/shut down |
44 |
+TimeoutSec=300 |
45 |
+ |
46 |
+# We rely on systemd, not mysqld_safe, to restart mysqld if it dies |
47 |
+Restart=always |
48 |
+ |
49 |
+# Place temp files in a secure directory, not /tmp |
50 |
+PrivateTmp=true |
51 |
+ |
52 |
+[Install] |
53 |
+WantedBy=multi-user.target |
54 |
|
55 |
diff --git a/dev-db/mysql-init-scripts/files/mysqld_at-v2.service b/dev-db/mysql-init-scripts/files/mysqld_at-v2.service |
56 |
new file mode 100644 |
57 |
index 0000000..4c6a8ca |
58 |
--- /dev/null |
59 |
+++ b/dev-db/mysql-init-scripts/files/mysqld_at-v2.service |
60 |
@@ -0,0 +1,26 @@ |
61 |
+[Unit] |
62 |
+Description=MySQL database server |
63 |
+ConditionPathExists=/etc/mysql/my%I.cnf |
64 |
+After=network.target |
65 |
+ |
66 |
+[Service] |
67 |
+Type=simple |
68 |
+User=mysql |
69 |
+Group=mysql |
70 |
+ |
71 |
+# Note: we set --basedir to prevent probes that might trigger SELinux alarms, |
72 |
+# https://bugzilla.redhat.com/show_bug.cgi?id=547485 |
73 |
+ExecStart=/usr/sbin/mysqld --defaults-file=/etc/mysql/my%I.cnf --basedir=/usr |
74 |
+ExecStartPost=/usr/libexec/mysqld-wait-ready $MAINPID |
75 |
+ |
76 |
+# Give a reasonable amount of time for the server to start up/shut down |
77 |
+TimeoutSec=300 |
78 |
+ |
79 |
+# We rely on systemd, not mysqld_safe, to restart mysqld if it dies |
80 |
+Restart=always |
81 |
+ |
82 |
+# Place temp files in a secure directory, not /tmp |
83 |
+PrivateTmp=true |
84 |
+ |
85 |
+[Install] |
86 |
+WantedBy=multi-user.target |
87 |
|
88 |
diff --git a/dev-db/mysql-init-scripts/mysql-init-scripts-2.1_rc1.ebuild b/dev-db/mysql-init-scripts/mysql-init-scripts-2.1_rc1.ebuild |
89 |
new file mode 100644 |
90 |
index 0000000..b47641d |
91 |
--- /dev/null |
92 |
+++ b/dev-db/mysql-init-scripts/mysql-init-scripts-2.1_rc1.ebuild |
93 |
@@ -0,0 +1,58 @@ |
94 |
+# Copyright 1999-2016 Gentoo Foundation |
95 |
+# Distributed under the terms of the GNU General Public License v2 |
96 |
+# $Id$ |
97 |
+ |
98 |
+EAPI=5 |
99 |
+ |
100 |
+inherit systemd s6 |
101 |
+ |
102 |
+DESCRIPTION="Gentoo MySQL init scripts." |
103 |
+HOMEPAGE="https://www.gentoo.org/" |
104 |
+SRC_URI="" |
105 |
+ |
106 |
+LICENSE="GPL-2" |
107 |
+SLOT="0" |
108 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd" |
109 |
+IUSE="" |
110 |
+ |
111 |
+DEPEND="" |
112 |
+# This _will_ break with MySQL 5.0, 4.x, 3.x |
113 |
+# It also NEEDS openrc for the save_options/get_options builtins. |
114 |
+# The s6 support was added after openrc 0.16.2 |
115 |
+RDEPEND=" |
116 |
+ !<dev-db/mysql-5.1 |
117 |
+ !<sys-apps/openrc-0.16.2 |
118 |
+ " |
119 |
+# Need to set S due to PMS saying we need it existing, but no SRC_URI |
120 |
+S=${WORKDIR} |
121 |
+ |
122 |
+src_install() { |
123 |
+ newconfd "${FILESDIR}/conf.d-2.0" "mysql" |
124 |
+ |
125 |
+ # s6 init scripts |
126 |
+ if use amd64 || use x86 ; then |
127 |
+ newconfd "${FILESDIR}/conf.d-2.0" "mysql-s6" |
128 |
+ newinitd "${FILESDIR}/init.d-s6" "mysql-s6" |
129 |
+ s6_install_service mysql "${FILESDIR}/run-s6" |
130 |
+ s6_install_service mysql/log "${FILESDIR}/log-s6" |
131 |
+ fi |
132 |
+ |
133 |
+ newinitd "${FILESDIR}/init.d-2.0" "mysql" |
134 |
+ |
135 |
+ # systemd unit installation |
136 |
+ exeinto /usr/libexec |
137 |
+ doexe "${FILESDIR}"/mysqld-wait-ready |
138 |
+ systemd_newunit "${FILESDIR}/mysqld-v2.service" "mysqld.service" |
139 |
+ systemd_newunit "${FILESDIR}/mysqld_at-v2.service" "mysqld@.service" |
140 |
+ systemd_dotmpfilesd "${FILESDIR}/mysql.conf" |
141 |
+ |
142 |
+ insinto /etc/logrotate.d |
143 |
+ newins "${FILESDIR}/logrotate.mysql" "mysql" |
144 |
+} |
145 |
+ |
146 |
+pkg_postinst() { |
147 |
+ if use amd64 || use x86 ; then |
148 |
+ elog "To use the mysql-s6 script, you need to install the optional sys-apps/s6 package." |
149 |
+ elog "If you wish to use s6 logging support, comment out the log-error setting in your my.cnf" |
150 |
+ fi |
151 |
+} |