MySQL Forums
Forum List  »  Install & Repo

Re: 8.0.16-2debian9 ?
Posted by: Lars Tangvald
Date: May 10, 2019 03:57PM

Hi,

The change is to the packaging for rpm and deb packages, and tries to ensure that the datadir/mysql_upgrade_info file is writable by the server.

The actual patch can be seen by downloading the source packages from the apt/yum repos at repo.mysql.com, but the dep-3 formatted patch is also below.
Basically, if the file is owned by root (the user executing the packaging scripts) it will be changed to have the same owner as datadir.
---
Description: Ensure correct ownership of datadir/mysql_upgrade_info
 This file must be writable by the server, or startup will fail.
 The patch sets ownership to be the same as datadir in general.
Author: MySQL Release Engineering <mysql-build@oss.oracle.com>
Bug: https://bugs.mysql.com/bug.php?id=95179
Last-Update: 2019-05-02

--- mysql-community-8.0.16.orig/packaging/deb-in/CMakeLists.txt
+++ mysql-community-8.0.16/packaging/deb-in/CMakeLists.txt
@@ -60,7 +60,7 @@ IF (DEB_PRODUCT STREQUAL "commercial")
   SET (DEB_PRODUCTNAMEC "${DEB_BASE_PRODUCTC}Enterprise")
   SET (DEB_NOTPRODUCTNAME "${DEB_BASE_PRODUCT}community")
   SET (DEB_LICENSENAME "Commercial")
-  SET (DEB_SERVERVERSION "${DEB_BASE_VERSION}+commercial-1")
+  SET (DEB_SERVERVERSION "${DEB_BASE_VERSION}+commercial-2")
   # List of plugins that are only in commercial packages
   # Plugins that are in both community and commercial should NOT be added here
   SET (DEB_INCLUDE_BINARIES_EXTRA
@@ -137,7 +137,7 @@ ELSE()
   SET (DEB_PRODUCTNAMEC "${DEB_BASE_PRODUCTC}Community")
   SET (DEB_NOTPRODUCTNAME "${DEB_BASE_PRODUCT}commercial")
   SET (DEB_LICENSENAME "GPL")
-  SET (DEB_SERVERVERSION "${DEB_BASE_VERSION}-1")
+  SET (DEB_SERVERVERSION "${DEB_BASE_VERSION}-2")
   SET (DEB_REMOVEPATTERN "com.in")
 ENDIF()
 
--- mysql-community-8.0.16.orig/packaging/deb-in/extra/mysql-helpers
+++ mysql-community-8.0.16/packaging/deb-in/extra/mysql-helpers
@@ -1,4 +1,4 @@
-# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License, version 2.0,
@@ -106,6 +106,11 @@ verify_ready() {
 			fi
 		fi
 
+		# Ensures that the mysql_upgrade_info file is owned by the database
+		if [ -O "${MYSQLDATA}/mysql_upgrade_info" ]; then
+			chown --reference="${MYSQLDATA}" "${MYSQLDATA}/mysql_upgrade_info"
+		fi
+
 		if [ ! -d ${MYSQLFILES} -a ! -L ${MYSQLFILES} ]; then
 			if [ "$(dirname "${MYSQLFILES}")" = "/var/lib" -o ${MYSQLFILES} = NULL ]; then
 				install -d -m0770 -omysql -gmysql ${MYSQLFILES}
--- mysql-community-8.0.16.orig/packaging/rpm-fedora/mysql.spec.in
+++ mysql-community-8.0.16/packaging/rpm-fedora/mysql.spec.in
@@ -64,7 +64,7 @@ Name:           mysql-%{product_suffix}
 Summary:        A very fast and reliable SQL database server
 Group:          Applications/Databases
 Version:        @MYSQL_NO_DASH_VERSION@
-Release:        1@MYSQL_VERSION_EXTRA_DOT@%{?dist}
+Release:        2@MYSQL_VERSION_EXTRA_DOT@%{?dist}
 License:        Copyright (c) 2000, @MYSQL_COPYRIGHT_YEAR@, %{mysql_vendor}. All rights reserved. Under %{?license_type} license as shown in the Description field.
 Source0:        https://cdn.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/%{src_dir}.tar.gz
 Source1:        https://downloads.sourceforge.net/boost/@BOOST_PACKAGE_NAME@.tar.bz2
--- mysql-community-8.0.16.orig/packaging/rpm-oel/mysql.init
+++ mysql-community-8.0.16/packaging/rpm-oel/mysql.init
@@ -73,6 +73,15 @@ install_validate_password_sql_file () {
     echo "$initfile"
 }
 
+fix_mysql_upgrade_info () {
+    if [ -d  "$datadir" ]  && [ -O "$datadir/mysql_upgrade_info" ]; then
+       chown --reference="$datadir" "$datadir/mysql_upgrade_info"
+       if [ -x /usr/bin/chcon ]; then
+	   /usr/bin/chcon --reference="$datadir" "$datadir/mysql_upgrade_info"
+       fi
+    fi
+}
+
 start(){
     [ -x $exec ] || exit 5
     # check to see if it's already running
@@ -92,6 +101,10 @@ start(){
 	    install /dev/null -m0640 -omysql -gmysql "$errlogfile"
 	fi
 	[ -x /sbin/restorecon ] && /sbin/restorecon "$errlogfile"
+
+	# mysql_upgrade_info file should be owned by mysql user since MySQL 8.0.16
+	fix_mysql_upgrade_info
+
 	if [ ! -d "$datadir/mysql" ] ; then
 	    # First, make sure $datadir is there with correct permissions
 	    if [ ! -d "$datadir" -a ! -h "$datadir" -a "x$(dirname "$datadir")" = "x/var/lib" ]; then
--- mysql-community-8.0.16.orig/packaging/rpm-oel/mysql.spec.in
+++ mysql-community-8.0.16/packaging/rpm-oel/mysql.spec.in
@@ -101,7 +101,7 @@ Name:           mysql%{?cluster:-cluster
 Summary:        A very fast and reliable SQL database server
 Group:          Applications/Databases
 Version:        @MYSQL_NO_DASH_VERSION@
-Release:        %{?cluster:0.}1@MYSQL_VERSION_EXTRA_DOT@%{?commercial:.1}%{?dist}
+Release:        %{?cluster:0.}2@MYSQL_VERSION_EXTRA_DOT@%{?commercial:.1}%{?dist}
 License:        Copyright (c) 2000, @MYSQL_COPYRIGHT_YEAR@, %{mysql_vendor}. All rights reserved. Under %{?license_type} license as shown in the Description field.
 Source0:        https://cdn.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/%{src_dir}.tar.gz
 URL:            http://www.mysql.com/
--- mysql-community-8.0.16.orig/packaging/rpm-sles/mysql.init
+++ mysql-community-8.0.16/packaging/rpm-sles/mysql.init
@@ -1,6 +1,6 @@
 #! /bin/bash
 #
-# Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License, version 2.0,
@@ -85,6 +85,15 @@ install_validate_password_sql_file () {
     echo $initfile
 }
 
+fix_mysql_upgrade_info () {
+    if [ -d  "$datadir" ]  && [ -O "$datadir/mysql_upgrade_info" ]; then
+       chown --reference="$datadir" "$datadir/mysql_upgrade_info"
+       if [ -x /usr/bin/chcon ]; then
+           /usr/bin/chcon --reference="$datadir" "$datadir/mysql_upgrade_info" > /dev/null 2>&1
+       fi
+    fi
+}
+
 install_db () {
     # Note: something different than datadir=/var/lib/mysql requires 
     # SELinux policy changes (in enforcing mode)
@@ -104,6 +113,9 @@ install_db () {
         /usr/sbin/restorecon "$logfile"
     fi
 
+    # mysql_upgrade_info file should be owned by mysql user since MySQL 8.0.16
+    fix_mysql_upgrade_info
+
     # If special mysql dir is in place, skip db install 
     [ -d "$datadir/mysql" ] && return 0
 
--- mysql-community-8.0.16.orig/packaging/rpm-sles/mysql.spec.in
+++ mysql-community-8.0.16/packaging/rpm-sles/mysql.spec.in
@@ -105,7 +105,7 @@ Name:           mysql%{?cluster:-cluster
 Summary:        A very fast and reliable SQL database server
 Group:          Applications/Databases
 Version:        @MYSQL_NO_DASH_VERSION@
-Release:        %{?cluster:0.}1@MYSQL_VERSION_EXTRA_DOT@%{?commercial:.1}%{?dist}
+Release:        %{?cluster:0.}2@MYSQL_VERSION_EXTRA_DOT@%{?commercial:.1}%{?dist}
 License:        Copyright (c) 2000, @MYSQL_COPYRIGHT_YEAR@, %{mysql_vendor}. All rights reserved. Under %{?license_type} license as shown in the Description field.
 Source0:        https://cdn.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/%{src_dir}.tar.gz
 URL:            http://www.mysql.com/

Options: ReplyQuote


Subject
Written By
Posted
May 10, 2019 08:40AM
Re: 8.0.16-2debian9 ?
May 10, 2019 03:57PM
May 12, 2019 10:28AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.