Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-db/mysql-init-scripts/files/, dev-db/mysql-init-scripts/
Date: Wed, 28 Aug 2019 14:43:38
Message-Id: 1567003402.88ee64577bc5e9b5343299ca3120bb5e6dba6b2c.whissi@gentoo
1 commit: 88ee64577bc5e9b5343299ca3120bb5e6dba6b2c
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Wed Aug 28 14:43:08 2019 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Wed Aug 28 14:43:22 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=88ee6457
7
8 dev-db/mysql-init-scripts: drop old
9
10 Package-Manager: Portage-2.3.72, Repoman-2.3.17
11 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
12
13 dev-db/mysql-init-scripts/files/init.d-2.2 | 194 ---------------------
14 dev-db/mysql-init-scripts/files/init.d-s6-2.2 | 163 -----------------
15 dev-db/mysql-init-scripts/files/init.d-supervise | 180 -------------------
16 dev-db/mysql-init-scripts/files/logrotate.mysql | 14 --
17 .../mysql-init-scripts-2.2-r3.ebuild | 65 -------
18 .../mysql-init-scripts-2.2-r4.ebuild | 67 -------
19 .../mysql-init-scripts-2.3-r1.ebuild | 67 -------
20 .../mysql-init-scripts-2.3-r2.ebuild | 71 --------
21 .../mysql-init-scripts-2.3.ebuild | 67 -------
22 9 files changed, 888 deletions(-)
23
24 diff --git a/dev-db/mysql-init-scripts/files/init.d-2.2 b/dev-db/mysql-init-scripts/files/init.d-2.2
25 deleted file mode 100644
26 index 5603f9e6031..00000000000
27 --- a/dev-db/mysql-init-scripts/files/init.d-2.2
28 +++ /dev/null
29 @@ -1,194 +0,0 @@
30 -#!/sbin/openrc-run
31 -# Copyright 1999-2018 Gentoo Foundation
32 -# Distributed under the terms of the GNU General Public License v2
33 -
34 -extra_commands="checkconfig"
35 -extra_stopped_commands="bootstrap_galera"
36 -
37 -description_checkconfig="Verify the server's configuration"
38 -description_boostrap_galera="Start a new Galera cluster with this server as the initial node"
39 -
40 -depend() {
41 - use net.lo
42 - # localmount needed for $basedir
43 - need localmount
44 - # This service has its own timeout and may need to wait for repairs
45 - # or remote synchronization
46 - keyword -timeout
47 -}
48 -
49 -get_config() {
50 - my_print_defaults --defaults-file="$1" mysqld server mariadb |
51 - sed -n -e "s/^--$2=//p"
52 -}
53 -
54 -mysql_svcname() {
55 - local ebextra=
56 - case "${SVCNAME}" in
57 - mysql*) ;;
58 - *) ebextra=" (mysql)" ;;
59 - esac
60 - echo "${SVCNAME}${ebextra}"
61 -}
62 -
63 -stringContain() { [ -z "${2##*$1*}" ] && [ -z "$1" -o -n "$2" ]; }
64 -
65 -bootstrap_galera() {
66 - MY_ARGS="--wsrep-new-cluster ${MY_ARGS}"
67 - mark_service_starting
68 - if start ; then
69 - mark_service_started
70 - return 0
71 - else
72 - mark_service_stopped
73 - return 1
74 - fi
75 -}
76 -
77 -start() {
78 - # Check for old conf.d variables that mean migration was not yet done.
79 - set | egrep -sq '^(mysql_slot_|MYSQL_BLOG_PID_FILE|STOPTIMEOUT)'
80 - rc=$?
81 - # Yes, MYSQL_INIT_I_KNOW_WHAT_I_AM_DOING is a hidden variable.
82 - # It does have a use in testing, as it is possible to build a config file
83 - # that works with both the old and new init scripts simulateously.
84 - if [ "${rc}" = 0 -a -z "${MYSQL_INIT_I_KNOW_WHAT_I_AM_DOING}" ]; then
85 - eerror "You have not updated your conf.d for the new mysql-init-scripts-2 revamp."
86 - eerror "Not proceeding because it may be dangerous."
87 - return 1
88 - fi
89 -
90 - # Check the config or die
91 - if [ ${RC_CMD} != "restart" ] ; then
92 - checkconfig || return 1
93 - fi
94 -
95 - # Now we can startup
96 - ebegin "Starting $(mysql_svcname)"
97 -
98 - MY_CNF="${MY_CNF:-/etc/${SVCNAME}/my.cnf}"
99 -
100 - if [ ! -r "${MY_CNF}" ] ; then
101 - eerror "Cannot read the configuration file \`${MY_CNF}'"
102 - return 1
103 - fi
104 -
105 - # tail -n1 is critical as these we only want the last instance of the option
106 - local basedir=$(get_config "${MY_CNF}" basedir | tail -n1)
107 - local pidfile=$(get_config "${MY_CNF}" pid-file | tail -n1)
108 - local socket=$(get_config "${MY_CNF}" socket | tail -n1)
109 - local chroot=$(get_config "${MY_CNF}" chroot | tail -n1)
110 - local wsrep="$(get_config "${MY_CNF}" 'wsrep[_-]on' | tail -n1 | awk '{print tolower($0)}')"
111 - local wsrep_new=$(get_config "${MY_CNF}" 'wsrep-new-cluster' | tail -n1)
112 -
113 - if [ -n "${chroot}" ] ; then
114 - socket="${chroot}/${socket}"
115 - pidfile="${chroot}/${pidfile}"
116 - fi
117 -
118 - # Galera: Only check datadir if not starting a new cluster and galera is enabled
119 - # wsrep_on is not on or wsrep-new-cluster exists in the config or MY_ARGS
120 - [ "${wsrep}" = "1" ] && wsrep="on"
121 - if [ "${wsrep}" != "on" ] || [ -n "${wsrep_new}" ] || stringContain 'wsrep-new-cluster' "${MY_ARGS}" ; then
122 -
123 - local datadir=$(get_config "${MY_CNF}" datadir | tail -n1)
124 - if [ ! -d "${datadir}" ] ; then
125 - eerror "MySQL datadir \`${datadir}' is empty or invalid"
126 - eerror "Please check your config file \`${MY_CNF}'"
127 - return 1
128 - fi
129 -
130 - if [ ! -d "${datadir}"/mysql ] ; then
131 - # find which package is installed to report an error
132 - local EROOT=$(portageq envvar EROOT)
133 - local DBPKG_P=$(portageq match ${EROOT} $(portageq expand_virtual ${EROOT} virtual/mysql | head -n1))
134 - if [ -z ${DBPKG_P} ] ; then
135 - eerror "You don't appear to have a server package installed yet."
136 - else
137 - eerror "You don't appear to have the mysql database installed yet."
138 - eerror "Please run \`emerge --config =${DBPKG_P}\` to have this done..."
139 - fi
140 - return 1
141 - fi
142 - fi
143 -
144 - local piddir="${pidfile%/*}"
145 - checkpath -d --owner mysql:mysql --mode 0755 "$piddir"
146 - rc=$?
147 - if [ $rc -ne 0 ]; then
148 - eerror "Directory $piddir for pidfile does not exist and cannot be created"
149 - return 1
150 - fi
151 -
152 - local startup_timeout=${STARTUP_TIMEOUT:-900}
153 - local startup_early_timeout=${STARTUP_EARLY_TIMEOUT:-1000}
154 - local tmpnice="${NICE:+"--nicelevel "}${NICE}"
155 - local tmpionice="${IONICE:+"--ionice "}${IONICE}"
156 - start-stop-daemon \
157 - ${DEBUG:+"--verbose"} \
158 - --start \
159 - --exec "${basedir}"/sbin/mysqld \
160 - --pidfile "${pidfile}" \
161 - --background \
162 - --wait ${startup_early_timeout} \
163 - ${tmpnice} \
164 - ${tmpionice} \
165 - -- --defaults-file="${MY_CNF}" ${MY_ARGS}
166 - local ret=$?
167 - if [ ${ret} -ne 0 ] ; then
168 - eend ${ret}
169 - return ${ret}
170 - fi
171 -
172 - ewaitfile ${startup_timeout} "${socket}"
173 - eend $? || return 1
174 -
175 - save_options pidfile "${pidfile}"
176 - save_options basedir "${basedir}"
177 -}
178 -
179 -stop() {
180 - if [ ${RC_CMD} = "restart" ] ; then
181 - checkconfig || return 1
182 - fi
183 -
184 - ebegin "Stopping $(mysql_svcname)"
185 -
186 - local pidfile="$(get_options pidfile)"
187 - local basedir="$(get_options basedir)"
188 - local stop_timeout=${STOP_TIMEOUT:-120}
189 -
190 - start-stop-daemon \
191 - ${DEBUG:+"--verbose"} \
192 - --stop \
193 - --exec "${basedir}"/sbin/mysqld \
194 - --pidfile "${pidfile}" \
195 - --retry ${stop_timeout}
196 - eend $?
197 -}
198 -
199 -checkconfig() {
200 - local my_cnf="${MY_CNF:-/etc/${SVCNAME}/my.cnf}"
201 - local basedir=$(get_config "${my_cnf}" basedir | tail -n1)
202 - local svc_name=$(mysql_svcname)
203 - ebegin "Checking mysqld configuration for ${svc_name}"
204 -
205 - if [ ${RC_CMD} = "checkconfig" ] ; then
206 - # We are calling checkconfig specifically. Print warnings regardless.
207 - "${basedir}"/sbin/mysqld --defaults-file="${my_cnf}" --help --verbose > /dev/null
208 - else
209 - # Suppress output to check the return value
210 - "${basedir}"/sbin/mysqld --defaults-file="${my_cnf}" --help --verbose > /dev/null 2>&1
211 -
212 - # If the above command does not return 0,
213 - # then there is an error to echo to the user
214 - if [ $? -ne 0 ] ; then
215 - "${basedir}"/sbin/mysqld --defaults-file="${my_cnf}" --help --verbose > /dev/null
216 - fi
217 - fi
218 -
219 - eend $? "${svc_name} config check failed"
220 -}
221 -
222 -# vim: filetype=gentoo-init-d sw=2 ts=2 sts=2 noet:
223 -
224
225 diff --git a/dev-db/mysql-init-scripts/files/init.d-s6-2.2 b/dev-db/mysql-init-scripts/files/init.d-s6-2.2
226 deleted file mode 100644
227 index 3fa54e949c9..00000000000
228 --- a/dev-db/mysql-init-scripts/files/init.d-s6-2.2
229 +++ /dev/null
230 @@ -1,163 +0,0 @@
231 -#!/sbin/openrc-run
232 -# Copyright 1999-2017 Gentoo Foundation
233 -# Distributed under the terms of the GNU General Public License v2
234 -
235 -depend() {
236 - use net.lo
237 - # localmount needed for $basedir
238 - need localmount s6-svscan
239 -}
240 -
241 -get_config() {
242 - my_print_defaults --defaults-file="$1" mysqld server mariadb |
243 - sed -n -e "s/^--$2=//p"
244 -}
245 -
246 -mysql_svcname() {
247 - local ebextra=
248 - case "${svc_name}" in
249 - mysql*) ;;
250 - *) ebextra=" (mysql)" ;;
251 - esac
252 - echo "${svc_name}${ebextra}"
253 -}
254 -
255 -stringContain() { [ -z "${2##*$1*}" ] && [ -z "$1" -o -n "$2" ]; }
256 -
257 -bootstrap_galera() {
258 - MY_ARGS="--wsrep-new-cluster ${MY_ARGS}"
259 - mark_service_starting
260 - if start_pre && start ; then
261 - mark_service_started
262 - return 0
263 - else
264 - mark_service_stopped
265 - return 1
266 - fi
267 -}
268 -
269 -
270 -extra_commands="checkconfig"
271 -extra_stopped_commands="bootstrap_galera"
272 -
273 -description_checkconfig="Verify the server's configuration"
274 -description_boostrap_galera="Start a new Galera cluster with this server as the initial node"
275 -supervisor=s6
276 -name=$(mysql_svcname)
277 -s6_service_timeout_stop="$((1000*${STOP_TIMEOUT:-120}))"
278 -#s6_svwait_options_start="-U -t $((1000*${STARTUP_EARLY_TIMEOUT:-1000}))"
279 -svc_name=${RC_SVCNAME%-s6}
280 -s6_service_path=/var/svc.d/${svc_name}
281 -
282 -start_pre() {
283 - # Check the config or die
284 - if [ ${RC_CMD} != "restart" ] ; then
285 - checkconfig || return 1
286 - fi
287 -
288 - MY_CNF="${MY_CNF:-/etc/${svc_name}/my.cnf}"
289 -
290 - if [ ! -r "${MY_CNF}" ] ; then
291 - eerror "Cannot read the configuration file \`${MY_CNF}'"
292 - return 1
293 - fi
294 -
295 - # tail -n1 is critical as these we only want the last instance of the option
296 - local basedir=$(get_config "${MY_CNF}" basedir | tail -n1)
297 - local pidfile=$(get_config "${MY_CNF}" pid-file | tail -n1)
298 - local socket=$(get_config "${MY_CNF}" socket | tail -n1)
299 - local chroot=$(get_config "${MY_CNF}" chroot | tail -n1)
300 - local wsrep="$(get_config "${MY_CNF}" 'wsrep[_-]on' | tail -n1 | awk '{print tolower($0)}')"
301 - local wsrep_new=$(get_config "${MY_CNF}" 'wsrep-new-cluster' | tail -n1)
302 -
303 - if [ -n "${chroot}" ] ; then
304 - socket="${chroot}/${socket}"
305 - pidfile="${chroot}/${pidfile}"
306 - fi
307 -
308 - # Galera: Only check datadir if not starting a new cluster and galera is enabled
309 - # wsrep_on is not on or wsrep-new-cluster exists in the config or MY_ARGS
310 - [ "${wsrep}" = "1" ] && wsrep="on"
311 - if [ "${wsrep}" != "on" ] || [ -n "${wsrep_new}" ] || stringContain 'wsrep-new-cluster' "${MY_ARGS}" ; then
312 -
313 - local datadir=$(get_config "${MY_CNF}" datadir | tail -n1)
314 - if [ ! -d "${datadir}" ] ; then
315 - eerror "MySQL datadir \`${datadir}' is empty or invalid"
316 - eerror "Please check your config file \`${MY_CNF}'"
317 - return 1
318 - fi
319 -
320 - if [ ! -d "${datadir}"/mysql ] ; then
321 - # find which package is installed to report an error
322 - local EROOT=$(portageq envvar EROOT)
323 - local DBPKG_P=$(portageq match ${EROOT} $(portageq expand_virtual ${EROOT} virtual/mysql | head -n1))
324 - if [ -z ${DBPKG_P} ] ; then
325 - eerror "You don't appear to have a server package installed yet."
326 - else
327 - eerror "You don't appear to have the mysql database installed yet."
328 - eerror "Please run \`emerge --config =${DBPKG_P}\` to have this done..."
329 - fi
330 - return 1
331 - fi
332 - fi
333 -
334 - local piddir="${pidfile%/*}"
335 - checkpath -d --owner mysql:mysql --mode 0755 "$piddir"
336 - rc=$?
337 - if [ $rc -ne 0 ]; then
338 - eerror "Directory $piddir for pidfile does not exist and cannot be created"
339 - return 1
340 - fi
341 -
342 - # Prepare env files to source
343 - mkdir -p "/var/svc.d/${svc_name}"
344 - echo "MY_CNF=\"${MY_CNF}\"" > "/var/svc.d/${svc_name}/env"
345 - echo "MY_ARGS=\"${MY_ARGS}\"" >> "/var/svc.d/${svc_name}/env"
346 - echo "basedir=\"${basedir}\"" >> "/var/svc.d/${svc_name}/env"
347 - mkdir -p "/var/svc.d/${svc_name}/log"
348 - echo "SVCNAME=\"${svc_name}\"" > "/var/svc.d/${svc_name}/log/env"
349 - echo "S6_LOG_OPTIONS=\"${S6_LOG_OPTIONS}\"" > "/var/svc.d/${svc_name}/log/env"
350 -}
351 -
352 -start_post() {
353 - local socket=$(get_config "${MY_CNF}" socket | tail -n1)
354 - local chroot=$(get_config "${MY_CNF}" chroot | tail -n1)
355 - local startup_timeout=${STARTUP_TIMEOUT:-900}
356 -
357 - if [ -n "${chroot}" ] ; then
358 - socket="${chroot}/${socket}"
359 - fi
360 - ewaitfile ${startup_timeout} "${socket}"
361 -}
362 -
363 -checkconfig() {
364 - local my_cnf="${MY_CNF:-/etc/${svc_name}/my.cnf}"
365 - local basedir=$(get_config "${my_cnf}" basedir | tail -n1)
366 - local svc_name=$(mysql_svcname)
367 - ebegin "Checking mysqld configuration for ${svc_name}"
368 -
369 - if [ ${RC_CMD} = "checkconfig" ] ; then
370 - # We are calling checkconfig specifically. Print warnings regardless.
371 - "${basedir}"/sbin/mysqld --defaults-file="${my_cnf}" --help --verbose > /dev/null
372 - else
373 - # Suppress output to check the return value
374 - "${basedir}"/sbin/mysqld --defaults-file="${my_cnf}" --help --verbose > /dev/null 2>&1
375 -
376 - # If the above command does not return 0,
377 - # then there is an error to echo to the user
378 - if [ $? -ne 0 ] ; then
379 - "${basedir}"/sbin/mysqld --defaults-file="${my_cnf}" --help --verbose > /dev/null
380 - fi
381 - fi
382 -
383 - eend $? "${svc_name} config check failed"
384 -}
385 -
386 -stop_pre() {
387 - if [ ${RC_CMD} = "restart" ] ; then
388 - checkconfig || return 1
389 - fi
390 -}
391 -
392 -# vim: filetype=gentoo-init-d sw=2 ts=2 sts=2 noet:
393 -
394
395 diff --git a/dev-db/mysql-init-scripts/files/init.d-supervise b/dev-db/mysql-init-scripts/files/init.d-supervise
396 deleted file mode 100644
397 index 5341a6a18d6..00000000000
398 --- a/dev-db/mysql-init-scripts/files/init.d-supervise
399 +++ /dev/null
400 @@ -1,180 +0,0 @@
401 -#!/sbin/openrc-run
402 -# Copyright 1999-2017 Gentoo Foundation
403 -# Distributed under the terms of the GNU General Public License v2
404 -
405 -extra_commands="checkconfig"
406 -extra_stopped_commands="boostrap_galera"
407 -
408 -description_checkconfig="Verify the server's configuration"
409 -description_boostrap_galera="Start a new Galera cluster with this server as the initial node"
410 -
411 -depend() {
412 - use net.lo
413 - # localmount needed for $basedir
414 - need localmount
415 -}
416 -
417 -get_config() {
418 - my_print_defaults --defaults-file="$1" mysqld server mariadb |
419 - sed -n -e "s/^--$2=//p"
420 -}
421 -
422 -mysql_svcname() {
423 - local ebextra=
424 - case "${SVCNAME}" in
425 - mysql*) ;;
426 - *) ebextra=" (mysql)" ;;
427 - esac
428 - echo "${SVCNAME}${ebextra}"
429 -}
430 -
431 -stringContain() { [ -z "${2##*$1*}" ] && [ -z "$1" -o -n "$2" ]; }
432 -
433 -bootstrap_galera() {
434 - MY_ARGS="--wsrep-new-cluster ${MY_ARGS}"
435 - mark_service_starting
436 - if start ; then
437 - mark_service_started
438 - return 0
439 - else
440 - mark_service_stopped
441 - return 1
442 - fi
443 -}
444 -
445 -start() {
446 - # Check for old conf.d variables that mean migration was not yet done.
447 - set | egrep -sq '^(mysql_slot_|MYSQL_BLOG_PID_FILE|STOPTIMEOUT)'
448 - rc=$?
449 - # Yes, MYSQL_INIT_I_KNOW_WHAT_I_AM_DOING is a hidden variable.
450 - # It does have a use in testing, as it is possible to build a config file
451 - # that works with both the old and new init scripts simulateously.
452 - if [ "${rc}" = 0 -a -z "${MYSQL_INIT_I_KNOW_WHAT_I_AM_DOING}" ]; then
453 - eerror "You have not updated your conf.d for the new mysql-init-scripts-2 revamp."
454 - eerror "Not proceeding because it may be dangerous."
455 - return 1
456 - fi
457 -
458 - # Check the config or die
459 - if [ ${RC_CMD} != "restart" ] ; then
460 - checkconfig || return 1
461 - fi
462 -
463 - # Now we can startup
464 - ebegin "Starting $(mysql_svcname)"
465 -
466 - MY_CNF="${MY_CNF:-/etc/${SVCNAME}/my.cnf}"
467 -
468 - if [ ! -r "${MY_CNF}" ] ; then
469 - eerror "Cannot read the configuration file \`${MY_CNF}'"
470 - return 1
471 - fi
472 -
473 - # tail -n1 is critical as these we only want the last instance of the option
474 - local basedir=$(get_config "${MY_CNF}" basedir | tail -n1)
475 - local pidfile=$(get_config "${MY_CNF}" pid-file | tail -n1)
476 - local socket=$(get_config "${MY_CNF}" socket | tail -n1)
477 - local chroot=$(get_config "${MY_CNF}" chroot | tail -n1)
478 - local wsrep="$(get_config "${MY_CNF}" 'wsrep[_-]on' | tail -n1 | awk '{print tolower($0)}')"
479 - local wsrep_new=$(get_config "${MY_CNF}" 'wsrep-new-cluster' | tail -n1)
480 -
481 - if [ -n "${chroot}" ] ; then
482 - socket="${chroot}/${socket}"
483 - pidfile="${chroot}/${pidfile}"
484 - fi
485 -
486 - # Galera: Only check datadir if not starting a new cluster and galera is enabled
487 - # wsrep_on is not on or wsrep-new-cluster exists in the config or MY_ARGS
488 - [ "${wsrep}" = "1" ] && wsrep="on"
489 - if [ "${wsrep}" != "on" ] || [ -n "${wsrep_new}" ] || stringContain 'wsrep-new-cluster' "${MY_ARGS}" ; then
490 -
491 - local datadir=$(get_config "${MY_CNF}" datadir | tail -n1)
492 - if [ ! -d "${datadir}" ] ; then
493 - eerror "MySQL datadir \`${datadir}' is empty or invalid"
494 - eerror "Please check your config file \`${MY_CNF}'"
495 - return 1
496 - fi
497 -
498 - if [ ! -d "${datadir}"/mysql ] ; then
499 - # find which package is installed to report an error
500 - local EROOT=$(portageq envvar EROOT)
501 - local DBPKG_P=$(portageq match ${EROOT} $(portageq expand_virtual ${EROOT} virtual/mysql | head -n1))
502 - if [ -z ${DBPKG_P} ] ; then
503 - eerror "You don't appear to have a server package installed yet."
504 - else
505 - eerror "You don't appear to have the mysql database installed yet."
506 - eerror "Please run \`emerge --config =${DBPKG_P}\` to have this done..."
507 - fi
508 - return 1
509 - fi
510 - fi
511 -
512 - local piddir="${pidfile%/*}"
513 - checkpath -d --owner mysql:mysql --mode 0755 "$piddir"
514 - rc=$?
515 - if [ $rc -ne 0 ]; then
516 - eerror "Directory $piddir for pidfile does not exist and cannot be created"
517 - return 1
518 - fi
519 -
520 - local startup_timeout=${STARTUP_TIMEOUT:-900}
521 -# local startup_early_timeout=${STARTUP_EARLY_TIMEOUT:-1000}
522 - local tmpnice="${NICE:+"--nicelevel "}${NICE}"
523 - local tmpionice="${IONICE:+"--ionice "}${IONICE}"
524 - supervise-daemon \
525 - ${DEBUG:+"--verbose"} \
526 - --pidfile "/run/${SVCNAME}.pid" \
527 - ${tmpnice} \
528 - ${tmpionice} \
529 - --start \
530 - "${basedir}"/sbin/mysqld \
531 - -- --defaults-file="${MY_CNF}" ${MY_ARGS}
532 - local ret=$?
533 - if [ ${ret} -ne 0 ] ; then
534 - eend ${ret}
535 - return ${ret}
536 - fi
537 -
538 - ewaitfile ${startup_timeout} "${socket}"
539 - eend $? || return 1
540 -}
541 -
542 -stop() {
543 - if [ ${RC_CMD} = "restart" ] ; then
544 - checkconfig || return 1
545 - fi
546 -
547 - ebegin "Stopping $(mysql_svcname)"
548 -
549 - supervise-daemon \
550 - ${DEBUG:+"--verbose"} \
551 - --stop \
552 - --pidfile "/run/${SVCNAME}.pid"
553 - eend $?
554 -}
555 -
556 -checkconfig() {
557 - local my_cnf="${MY_CNF:-/etc/${SVCNAME}/my.cnf}"
558 - local basedir=$(get_config "${my_cnf}" basedir | tail -n1)
559 - local svc_name=$(mysql_svcname)
560 - ebegin "Checking mysqld configuration for ${svc_name}"
561 -
562 - if [ ${RC_CMD} = "checkconfig" ] ; then
563 - # We are calling checkconfig specifically. Print warnings regardless.
564 - "${basedir}"/sbin/mysqld --defaults-file="${my_cnf}" --help --verbose > /dev/null
565 - else
566 - # Suppress output to check the return value
567 - "${basedir}"/sbin/mysqld --defaults-file="${my_cnf}" --help --verbose > /dev/null 2>&1
568 -
569 - # If the above command does not return 0,
570 - # then there is an error to echo to the user
571 - if [ $? -ne 0 ] ; then
572 - "${basedir}"/sbin/mysqld --defaults-file="${my_cnf}" --help --verbose > /dev/null
573 - fi
574 - fi
575 -
576 - eend $? "${svc_name} config check failed"
577 -}
578 -
579 -# vim: filetype=gentoo-init-d sw=2 ts=2 sts=2 noet:
580 -
581
582 diff --git a/dev-db/mysql-init-scripts/files/logrotate.mysql b/dev-db/mysql-init-scripts/files/logrotate.mysql
583 deleted file mode 100644
584 index afb20c66d47..00000000000
585 --- a/dev-db/mysql-init-scripts/files/logrotate.mysql
586 +++ /dev/null
587 @@ -1,14 +0,0 @@
588 -# Copyright 1999-2011 Gentoo Foundation
589 -# Distributed under the terms of the GNU General Public License v2
590 -
591 -/var/log/mysql/mysql.err /var/log/mysql/mysql.log /var/log/mysql/mysqld.err {
592 -monthly
593 -create 660 mysql mysql
594 -notifempty
595 -size 5M
596 -sharedscripts
597 -missingok
598 -postrotate
599 -[ -f /var/run/mysqld/mysqld.pid ] && /bin/kill -HUP `cat /var/run/mysqld/mysqld.pid`
600 -endscript
601 -}
602
603 diff --git a/dev-db/mysql-init-scripts/mysql-init-scripts-2.2-r3.ebuild b/dev-db/mysql-init-scripts/mysql-init-scripts-2.2-r3.ebuild
604 deleted file mode 100644
605 index d0a1278895f..00000000000
606 --- a/dev-db/mysql-init-scripts/mysql-init-scripts-2.2-r3.ebuild
607 +++ /dev/null
608 @@ -1,65 +0,0 @@
609 -# Copyright 1999-2018 Gentoo Foundation
610 -# Distributed under the terms of the GNU General Public License v2
611 -
612 -EAPI=6
613 -
614 -inherit systemd s6 tmpfiles
615 -
616 -DESCRIPTION="Gentoo MySQL init scripts."
617 -HOMEPAGE="https://www.gentoo.org/"
618 -SRC_URI=""
619 -
620 -LICENSE="GPL-2"
621 -SLOT="0"
622 -KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~x86-fbsd"
623 -IUSE=""
624 -
625 -DEPEND=""
626 -# This _will_ break with MySQL 5.0, 4.x, 3.x
627 -# It also NEEDS openrc for the save_options/get_options builtins.
628 -# The s6 support was added after openrc 0.16.2
629 -RDEPEND="
630 - !<dev-db/mysql-5.1
631 - !<sys-apps/openrc-0.16.2
632 - "
633 -# Need to set S due to PMS saying we need it existing, but no SRC_URI
634 -S=${WORKDIR}
635 -
636 -src_install() {
637 - newconfd "${FILESDIR}/conf.d-2.0" "mysql"
638 -
639 - # s6 init scripts
640 - if use amd64 || use x86 ; then
641 - newconfd "${FILESDIR}/conf.d-2.0" "mysql-s6"
642 - newinitd "${FILESDIR}/init.d-s6-2.2" "mysql-s6"
643 - s6_install_service mysql "${FILESDIR}/run-s6"
644 - s6_install_service mysql/log "${FILESDIR}/log-s6"
645 - fi
646 -
647 - newinitd "${FILESDIR}/init.d-2.2" "mysql"
648 - newinitd "${FILESDIR}/init.d-supervise" "mysql-supervise"
649 -
650 - # systemd unit installation
651 - exeinto /usr/libexec
652 - doexe "${FILESDIR}"/mysqld-wait-ready
653 - systemd_newunit "${FILESDIR}/mysqld-v2.service" "mysqld.service"
654 - systemd_newunit "${FILESDIR}/mysqld_at-v2.service" "mysqld@.service"
655 - dotmpfiles "${FILESDIR}/mysql.conf"
656 -
657 - insinto /etc/logrotate.d
658 - newins "${FILESDIR}/logrotate.mysql" "mysql"
659 -}
660 -
661 -pkg_postinst() {
662 - tmpfiles_process mysql.conf
663 - if use amd64 || use x86 ; then
664 - elog ""
665 - elog "To use the mysql-s6 script, you need to install the optional sys-apps/s6 package."
666 - elog "If you wish to use s6 logging support, comment out the log-error setting in your my.cnf"
667 - fi
668 -
669 - elog ""
670 - elog "Starting with version 10.1.8, MariaDB includes an improved systemd unit named mariadb.service"
671 - elog "You should prefer that unit over this package's mysqld.service."
672 - einfo ""
673 -}
674
675 diff --git a/dev-db/mysql-init-scripts/mysql-init-scripts-2.2-r4.ebuild b/dev-db/mysql-init-scripts/mysql-init-scripts-2.2-r4.ebuild
676 deleted file mode 100644
677 index 2028d860d3d..00000000000
678 --- a/dev-db/mysql-init-scripts/mysql-init-scripts-2.2-r4.ebuild
679 +++ /dev/null
680 @@ -1,67 +0,0 @@
681 -# Copyright 1999-2018 Gentoo Foundation
682 -# Distributed under the terms of the GNU General Public License v2
683 -
684 -EAPI=6
685 -
686 -inherit systemd s6 tmpfiles
687 -
688 -DESCRIPTION="Gentoo MySQL init scripts."
689 -HOMEPAGE="https://www.gentoo.org/"
690 -SRC_URI=""
691 -
692 -LICENSE="GPL-2"
693 -SLOT="0"
694 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
695 -IUSE=""
696 -
697 -DEPEND=""
698 -# This _will_ break with MySQL 5.0, 4.x, 3.x
699 -# It also NEEDS openrc for the save_options/get_options builtins.
700 -# The s6 support was added after openrc 0.16.2
701 -# mysql-connector-c needed for my_print_defaults
702 -RDEPEND="
703 - !<dev-db/mysql-5.1
704 - !<sys-apps/openrc-0.16.2
705 - dev-db/mysql-connector-c
706 - "
707 -# Need to set S due to PMS saying we need it existing, but no SRC_URI
708 -S=${WORKDIR}
709 -
710 -src_install() {
711 - newconfd "${FILESDIR}/conf.d-2.0" "mysql"
712 -
713 - # s6 init scripts
714 - if use amd64 || use x86 ; then
715 - newconfd "${FILESDIR}/conf.d-2.0" "mysql-s6"
716 - newinitd "${FILESDIR}/init.d-s6-2.2" "mysql-s6"
717 - s6_install_service mysql "${FILESDIR}/run-s6"
718 - s6_install_service mysql/log "${FILESDIR}/log-s6"
719 - fi
720 -
721 - newinitd "${FILESDIR}/init.d-2.2" "mysql"
722 - newinitd "${FILESDIR}/init.d-supervise" "mysql-supervise"
723 -
724 - # systemd unit installation
725 - exeinto /usr/libexec
726 - doexe "${FILESDIR}"/mysqld-wait-ready
727 - systemd_newunit "${FILESDIR}/mysqld-v2.service" "mysqld.service"
728 - systemd_newunit "${FILESDIR}/mysqld_at-v2.service" "mysqld@.service"
729 - dotmpfiles "${FILESDIR}/mysql.conf"
730 -
731 - insinto /etc/logrotate.d
732 - newins "${FILESDIR}/logrotate.mysql" "mysql"
733 -}
734 -
735 -pkg_postinst() {
736 - tmpfiles_process mysql.conf
737 - if use amd64 || use x86 ; then
738 - elog ""
739 - elog "To use the mysql-s6 script, you need to install the optional sys-apps/s6 package."
740 - elog "If you wish to use s6 logging support, comment out the log-error setting in your my.cnf"
741 - fi
742 -
743 - elog ""
744 - elog "Starting with version 10.1.8, MariaDB includes an improved systemd unit named mariadb.service"
745 - elog "You should prefer that unit over this package's mysqld.service."
746 - einfo ""
747 -}
748
749 diff --git a/dev-db/mysql-init-scripts/mysql-init-scripts-2.3-r1.ebuild b/dev-db/mysql-init-scripts/mysql-init-scripts-2.3-r1.ebuild
750 deleted file mode 100644
751 index b3283cf3ba2..00000000000
752 --- a/dev-db/mysql-init-scripts/mysql-init-scripts-2.3-r1.ebuild
753 +++ /dev/null
754 @@ -1,67 +0,0 @@
755 -# Copyright 1999-2019 Gentoo Authors
756 -# Distributed under the terms of the GNU General Public License v2
757 -
758 -EAPI=6
759 -
760 -inherit systemd s6 tmpfiles
761 -
762 -DESCRIPTION="Gentoo MySQL init scripts."
763 -HOMEPAGE="https://www.gentoo.org/"
764 -SRC_URI=""
765 -
766 -LICENSE="GPL-2"
767 -SLOT="0"
768 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
769 -IUSE=""
770 -
771 -DEPEND=""
772 -# This _will_ break with MySQL 5.0, 4.x, 3.x
773 -# It also NEEDS openrc for the save_options/get_options builtins.
774 -# The s6 support was added after openrc 0.16.2
775 -# mysql-connector-c needed for my_print_defaults
776 -RDEPEND="
777 - !<dev-db/mysql-5.1
778 - !<sys-apps/openrc-0.16.2
779 - dev-db/mysql-connector-c
780 - "
781 -# Need to set S due to PMS saying we need it existing, but no SRC_URI
782 -S=${WORKDIR}
783 -
784 -src_install() {
785 - newconfd "${FILESDIR}/conf.d-2.0" "mysql"
786 -
787 - # s6 init scripts
788 - if use amd64 || use x86 ; then
789 - newconfd "${FILESDIR}/conf.d-2.0" "mysql-s6"
790 - newinitd "${FILESDIR}/init.d-s6-2.3" "mysql-s6"
791 - s6_install_service mysql "${FILESDIR}/run-s6"
792 - s6_install_service mysql/log "${FILESDIR}/log-s6"
793 - fi
794 -
795 - newinitd "${FILESDIR}/init.d-2.3" "mysql"
796 - newinitd "${FILESDIR}/init.d-supervise-2.3" "mysql-supervise"
797 -
798 - # systemd unit installation
799 - exeinto /usr/libexec
800 - doexe "${FILESDIR}"/mysqld-wait-ready
801 - systemd_newunit "${FILESDIR}/mysqld-v2.service" "mysqld.service"
802 - systemd_newunit "${FILESDIR}/mysqld_at-v2.service" "mysqld@.service"
803 - dotmpfiles "${FILESDIR}/mysql.conf"
804 -
805 - insinto /etc/logrotate.d
806 - newins "${FILESDIR}/logrotate.mysql-2.3" "mysql"
807 -}
808 -
809 -pkg_postinst() {
810 - tmpfiles_process mysql.conf
811 - if use amd64 || use x86 ; then
812 - elog ""
813 - elog "To use the mysql-s6 script, you need to install the optional sys-apps/s6 package."
814 - elog "If you wish to use s6 logging support, comment out the log-error setting in your my.cnf"
815 - fi
816 -
817 - elog ""
818 - elog "Starting with version 10.1.8, MariaDB includes an improved systemd unit named mariadb.service"
819 - elog "You should prefer that unit over this package's mysqld.service."
820 - einfo ""
821 -}
822
823 diff --git a/dev-db/mysql-init-scripts/mysql-init-scripts-2.3-r2.ebuild b/dev-db/mysql-init-scripts/mysql-init-scripts-2.3-r2.ebuild
824 deleted file mode 100644
825 index dc33b534706..00000000000
826 --- a/dev-db/mysql-init-scripts/mysql-init-scripts-2.3-r2.ebuild
827 +++ /dev/null
828 @@ -1,71 +0,0 @@
829 -# Copyright 1999-2019 Gentoo Authors
830 -# Distributed under the terms of the GNU General Public License v2
831 -
832 -EAPI=6
833 -
834 -inherit systemd s6 tmpfiles
835 -
836 -DESCRIPTION="Gentoo MySQL init scripts."
837 -HOMEPAGE="https://www.gentoo.org/"
838 -SRC_URI=""
839 -
840 -LICENSE="GPL-2"
841 -SLOT="0"
842 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
843 -IUSE=""
844 -
845 -DEPEND="
846 - !prefix? (
847 - acct-group/mysql acct-user/mysql
848 - )
849 - "
850 -# This _will_ break with MySQL 5.0, 4.x, 3.x
851 -# It also NEEDS openrc for the save_options/get_options builtins.
852 -# The s6 support was added after openrc 0.16.2
853 -# mysql-connector-c needed for my_print_defaults
854 -RDEPEND="
855 - !<dev-db/mysql-5.1
856 - !<sys-apps/openrc-0.16.2
857 - dev-db/mysql-connector-c
858 - "
859 -# Need to set S due to PMS saying we need it existing, but no SRC_URI
860 -S=${WORKDIR}
861 -
862 -src_install() {
863 - newconfd "${FILESDIR}/conf.d-2.0" "mysql"
864 -
865 - # s6 init scripts
866 - if use amd64 || use x86 ; then
867 - newconfd "${FILESDIR}/conf.d-2.0" "mysql-s6"
868 - newinitd "${FILESDIR}/init.d-s6-2.3" "mysql-s6"
869 - s6_install_service mysql "${FILESDIR}/run-s6"
870 - s6_install_service mysql/log "${FILESDIR}/log-s6"
871 - fi
872 -
873 - newinitd "${FILESDIR}/init.d-2.3" "mysql"
874 - newinitd "${FILESDIR}/init.d-supervise-2.3" "mysql-supervise"
875 -
876 - # systemd unit installation
877 - exeinto /usr/libexec
878 - doexe "${FILESDIR}"/mysqld-wait-ready
879 - systemd_newunit "${FILESDIR}/mysqld-v2.service" "mysqld.service"
880 - systemd_newunit "${FILESDIR}/mysqld_at-v2.service" "mysqld@.service"
881 - dotmpfiles "${FILESDIR}/mysql.conf"
882 -
883 - insinto /etc/logrotate.d
884 - newins "${FILESDIR}/logrotate.mysql-2.3" "mysql"
885 -}
886 -
887 -pkg_postinst() {
888 - tmpfiles_process mysql.conf
889 - if use amd64 || use x86 ; then
890 - elog ""
891 - elog "To use the mysql-s6 script, you need to install the optional sys-apps/s6 package."
892 - elog "If you wish to use s6 logging support, comment out the log-error setting in your my.cnf"
893 - fi
894 -
895 - elog ""
896 - elog "Starting with version 10.1.8, MariaDB includes an improved systemd unit named mariadb.service"
897 - elog "You should prefer that unit over this package's mysqld.service."
898 - einfo ""
899 -}
900
901 diff --git a/dev-db/mysql-init-scripts/mysql-init-scripts-2.3.ebuild b/dev-db/mysql-init-scripts/mysql-init-scripts-2.3.ebuild
902 deleted file mode 100644
903 index 303b86680e0..00000000000
904 --- a/dev-db/mysql-init-scripts/mysql-init-scripts-2.3.ebuild
905 +++ /dev/null
906 @@ -1,67 +0,0 @@
907 -# Copyright 1999-2019 Gentoo Authors
908 -# Distributed under the terms of the GNU General Public License v2
909 -
910 -EAPI=6
911 -
912 -inherit systemd s6 tmpfiles
913 -
914 -DESCRIPTION="Gentoo MySQL init scripts."
915 -HOMEPAGE="https://www.gentoo.org/"
916 -SRC_URI=""
917 -
918 -LICENSE="GPL-2"
919 -SLOT="0"
920 -KEYWORDS="alpha amd64 arm arm64 ~hppa ia64 ~mips ppc ppc64 ~s390 ~sh ~sparc x86 ~x86-fbsd"
921 -IUSE=""
922 -
923 -DEPEND=""
924 -# This _will_ break with MySQL 5.0, 4.x, 3.x
925 -# It also NEEDS openrc for the save_options/get_options builtins.
926 -# The s6 support was added after openrc 0.16.2
927 -# mysql-connector-c needed for my_print_defaults
928 -RDEPEND="
929 - !<dev-db/mysql-5.1
930 - !<sys-apps/openrc-0.16.2
931 - dev-db/mysql-connector-c
932 - "
933 -# Need to set S due to PMS saying we need it existing, but no SRC_URI
934 -S=${WORKDIR}
935 -
936 -src_install() {
937 - newconfd "${FILESDIR}/conf.d-2.0" "mysql"
938 -
939 - # s6 init scripts
940 - if use amd64 || use x86 ; then
941 - newconfd "${FILESDIR}/conf.d-2.0" "mysql-s6"
942 - newinitd "${FILESDIR}/init.d-s6-2.3" "mysql-s6"
943 - s6_install_service mysql "${FILESDIR}/run-s6"
944 - s6_install_service mysql/log "${FILESDIR}/log-s6"
945 - fi
946 -
947 - newinitd "${FILESDIR}/init.d-2.3" "mysql"
948 - newinitd "${FILESDIR}/init.d-supervise-2.3" "mysql-supervise"
949 -
950 - # systemd unit installation
951 - exeinto /usr/libexec
952 - doexe "${FILESDIR}"/mysqld-wait-ready
953 - systemd_newunit "${FILESDIR}/mysqld-v2.service" "mysqld.service"
954 - systemd_newunit "${FILESDIR}/mysqld_at-v2.service" "mysqld@.service"
955 - dotmpfiles "${FILESDIR}/mysql.conf"
956 -
957 - insinto /etc/logrotate.d
958 - newins "${FILESDIR}/logrotate.mysql-2.3" "mysql"
959 -}
960 -
961 -pkg_postinst() {
962 - tmpfiles_process mysql.conf
963 - if use amd64 || use x86 ; then
964 - elog ""
965 - elog "To use the mysql-s6 script, you need to install the optional sys-apps/s6 package."
966 - elog "If you wish to use s6 logging support, comment out the log-error setting in your my.cnf"
967 - fi
968 -
969 - elog ""
970 - elog "Starting with version 10.1.8, MariaDB includes an improved systemd unit named mariadb.service"
971 - elog "You should prefer that unit over this package's mysqld.service."
972 - einfo ""
973 -}