diff options
author | Michał Górny <mgorny@gentoo.org> | 2013-09-19 08:46:40 +0000 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2013-09-19 08:46:40 +0000 |
commit | 76a7c8b76d2a7260e798f0b0f6b87ac2be830b92 (patch) | |
tree | af3480b8f7191663f2672637c0a0b1d7b8489754 /dev-db | |
parent | Version bump. Removed old (diff) | |
download | gentoo-2-76a7c8b76d2a7260e798f0b0f6b87ac2be830b92.tar.gz gentoo-2-76a7c8b76d2a7260e798f0b0f6b87ac2be830b92.tar.bz2 gentoo-2-76a7c8b76d2a7260e798f0b0f6b87ac2be830b92.zip |
Kill the pointless & unsafe automatic database creation wrt bug #483526.
(Portage version: 2.2.6/cvs/Linux x86_64, signed Manifest commit with key EFB4464E!)
Diffstat (limited to 'dev-db')
-rw-r--r-- | dev-db/mysql-init-scripts/ChangeLog | 10 | ||||
-rw-r--r-- | dev-db/mysql-init-scripts/files/mysqld-prepare-db-dir | 83 | ||||
-rw-r--r-- | dev-db/mysql-init-scripts/files/mysqld.service | 1 | ||||
-rw-r--r-- | dev-db/mysql-init-scripts/files/mysqld_at.service | 1 | ||||
-rw-r--r-- | dev-db/mysql-init-scripts/mysql-init-scripts-2.0_pre1-r5.ebuild (renamed from dev-db/mysql-init-scripts/mysql-init-scripts-2.0_pre1-r4.ebuild) | 4 |
5 files changed, 11 insertions, 88 deletions
diff --git a/dev-db/mysql-init-scripts/ChangeLog b/dev-db/mysql-init-scripts/ChangeLog index 3600061de8df..9f4784850d09 100644 --- a/dev-db/mysql-init-scripts/ChangeLog +++ b/dev-db/mysql-init-scripts/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for dev-db/mysql-init-scripts # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql-init-scripts/ChangeLog,v 1.28 2013/09/03 18:49:48 pacho Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql-init-scripts/ChangeLog,v 1.29 2013/09/19 08:46:40 mgorny Exp $ + +*mysql-init-scripts-2.0_pre1-r5 (19 Sep 2013) + + 19 Sep 2013; Michał Górny <mgorny@gentoo.org> + +mysql-init-scripts-2.0_pre1-r5.ebuild, -files/mysqld-prepare-db-dir, + -mysql-init-scripts-2.0_pre1-r4.ebuild, files/mysqld.service, + files/mysqld_at.service: + Kill the pointless & unsafe automatic database creation wrt bug #483526. *mysql-init-scripts-2.0_pre1-r4 (03 Sep 2013) diff --git a/dev-db/mysql-init-scripts/files/mysqld-prepare-db-dir b/dev-db/mysql-init-scripts/files/mysqld-prepare-db-dir deleted file mode 100644 index 80df2206680b..000000000000 --- a/dev-db/mysql-init-scripts/files/mysqld-prepare-db-dir +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/sh - -# This script creates the mysql data directory during first service start. -# In subsequent starts, it does nothing much. - -# extract value of a MySQL option from config files -# Usage: get_mysql_option SECTION VARNAME DEFAULT -# result is returned in $result -# We use my_print_defaults which prints all options from multiple files, -# with the more specific ones later; hence take the last match. -get_mysql_option(){ - result=`/usr/bin/my_print_defaults "$1" | sed -n "s/^--$2=//p" | tail -n 1` - if [ -z "$result" ]; then - # not found, use default - result="$3" - fi -} - -# Defaults here had better match what mysqld_safe will default to -get_mysql_option mysqld datadir "/var/lib/mysql" -datadir="$result" -get_mysql_option mysqld_safe log-error "/var/log/mysql/mysql.log" -errlogfile="$result" - -# Absorb configuration settings from the specified systemd service file, -# or the default "mysqld" service if not specified -SERVICE_NAME="$1" -if [ x"$SERVICE_NAME" = x ] -then - SERVICE_NAME=mysqld.service -fi - -myuser=`systemctl show -p User "${SERVICE_NAME}" | - sed 's/^User=//'` -if [ x"$myuser" = x ] -then - myuser=mysql -fi - -mygroup=`systemctl show -p Group "${SERVICE_NAME}" | - sed 's/^Group=//'` -if [ x"$mygroup" = x ] -then - mygroup=mysql -fi - -# Set up the errlogfile with appropriate permissions -touch "$errlogfile" -chown "$myuser:$mygroup" "$errlogfile" -chmod 0640 "$errlogfile" -[ -x /sbin/restorecon ] && /sbin/restorecon "$errlogfile" - -# Make the data directory -if [ ! -d "$datadir/mysql" ] ; then - # First, make sure $datadir is there with correct permissions - # (note: if it's not, and we're not root, this'll fail ...) - if [ ! -e "$datadir" -a ! -h "$datadir" ] - then - mkdir -p "$datadir" || exit 1 - fi - chown "$myuser:$mygroup" "$datadir" - chmod 0755 "$datadir" - [ -x /sbin/restorecon ] && /sbin/restorecon "$datadir" - - # Now create the database - echo "Initializing MySQL database" - /usr/share/mysql/scripts/mysql_install_db \ - --datadir="$datadir" --user="$myuser" --basedir="/usr" - ret=$? - if [ $ret -ne 0 ] ; then - echo "Initialization of MySQL database failed." >&2 - echo "Perhaps /etc/mysql/my.cnf is misconfigured." >&2 - # Clean up any partially-created database files - if [ ! -e "$datadir/mysql/user.frm" ] ; then - rm -rf "$datadir"/* - fi - exit $ret - fi - # In case we're running as root, make sure files are owned properly - chown -R "$myuser:$mygroup" "$datadir" -fi - -exit 0 diff --git a/dev-db/mysql-init-scripts/files/mysqld.service b/dev-db/mysql-init-scripts/files/mysqld.service index 3193ce2f0864..8cce47ace709 100644 --- a/dev-db/mysql-init-scripts/files/mysqld.service +++ b/dev-db/mysql-init-scripts/files/mysqld.service @@ -27,7 +27,6 @@ Type=simple User=mysql Group=mysql -ExecStartPre=/usr/libexec/mysqld-prepare-db-dir %n # Note: we set --basedir to prevent probes that might trigger SELinux alarms, # per bug #547485 ExecStart=/usr/bin/mysqld_safe --basedir=/usr diff --git a/dev-db/mysql-init-scripts/files/mysqld_at.service b/dev-db/mysql-init-scripts/files/mysqld_at.service index afcec18ba8cb..1ba2a8f8a2d0 100644 --- a/dev-db/mysql-init-scripts/files/mysqld_at.service +++ b/dev-db/mysql-init-scripts/files/mysqld_at.service @@ -27,7 +27,6 @@ Type=simple User=mysql Group=mysql -ExecStartPre=/usr/libexec/mysqld-prepare-db-dir %n # Note: we set --basedir to prevent probes that might trigger SELinux alarms, # per bug #547485 ExecStart=/usr/bin/mysqld_safe --defaults-file=/etc/mysql/my%I.cnf --basedir=/usr diff --git a/dev-db/mysql-init-scripts/mysql-init-scripts-2.0_pre1-r4.ebuild b/dev-db/mysql-init-scripts/mysql-init-scripts-2.0_pre1-r5.ebuild index 560e8da31129..80260edce212 100644 --- a/dev-db/mysql-init-scripts/mysql-init-scripts-2.0_pre1-r4.ebuild +++ b/dev-db/mysql-init-scripts/mysql-init-scripts-2.0_pre1-r5.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql-init-scripts/mysql-init-scripts-2.0_pre1-r4.ebuild,v 1.1 2013/09/03 18:49:48 pacho Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql-init-scripts/mysql-init-scripts-2.0_pre1-r5.ebuild,v 1.1 2013/09/19 08:46:40 mgorny Exp $ inherit systemd @@ -24,7 +24,7 @@ src_install() { # systemd unit installation exeinto /usr/libexec - doexe "${FILESDIR}"/{mysqld-prepare-db-dir,mysqld-wait-ready} + doexe "${FILESDIR}"/mysqld-wait-ready systemd_dounit "${FILESDIR}/mysqld.service" systemd_newunit "${FILESDIR}/mysqld_at.service" "mysqld@.service" systemd_dotmpfilesd "${FILESDIR}/mysql.conf" |