Bug 205093

Summary: databases/mysql56-server: First run misplaces my.cnf directly into /usr/local/
Product: Ports & Packages Reporter: amvandemore
Component: Individual Port(s)Assignee: Mark Felder <feld>
Status: Closed Overcome By Events    
Severity: Affects Some People CC: feld, ports-bugs, rootservice
Priority: --- Keywords: easy, needs-patch, needs-qa
Version: LatestFlags: bugzilla: maintainer-feedback? (ale)
Hardware: Any   
OS: Any   
Bug Depends on: 216244    
Bug Blocks:    
Attachments:
Description Flags
fix by adding --keep-my.cnf to mysql_install_db options rootservice: maintainer-approval? (ports-bugs)

Description amvandemore 2015-12-07 15:50:43 UTC
According to hier(7) and almost all other ports,

/usr/local/etc

is the default location for configuration files.  This port installs /usr/local/my.cnf via the /usr/local/etc/rc.d/mysql-server script.

For example, on this system with 1072 pkg's installed, only this one finds it necessary to install to /usr/local/:

# ll /usr/local/
total 984
drwxr-xr-x   22 root  wheel    23 Dec  7 09:46 ./
drwxr-xr-x   17 root  wheel    17 Aug  2 22:39 ../
drwxr-xr-x    4 root  wheel  2833 Nov 27 22:02 bin/
drwxr-xr-x    2 root  wheel    26 Nov 27 10:11 bin32/
drwxr-xr-x    2 root  wheel     4 Sep 11 00:52 env/
drwxr-xr-x   47 root  wheel    88 Nov 27 10:08 etc/
drwxr-xr-x  388 root  wheel  1263 Nov 27 22:02 include/
drwxr-xr-x    3 root  wheel    86 Nov 27 10:11 info/
drwxr-xr-x  105 root  wheel  3766 Nov 27 22:02 lib/
drwxr-xr-x    5 root  wheel    51 Nov 27 10:11 lib32/
drwxr-xr-x    5 root  wheel     5 Sep 11 00:52 libdata/
drwxr-xr-x   11 root  wheel    68 Nov 22 09:10 libexec/
drwxr-xr-x    5 root  wheel     5 Jan 21  2015 llvm33/
drwxr-xr-x    6 root  wheel     6 Feb 14  2015 llvm35/
drwxr-xr-x    6 root  wheel     6 Sep 28 07:51 llvm36/
drwxr-xr-x   33 root  wheel    34 Dec  5 04:15 man/
-rw-r--r--    1 root  wheel   943 Dec  7 09:46 my.cnf
drwxr-xr-x    9 root  wheel    14 Nov 10 10:48 openjdk8/
drwxr-xr-x    5 root  wheel     8 Nov 22 09:10 openssl/
drwxr-xr-x    2 root  wheel    71 Dec  4 20:41 sbin/
drwxr-xr-x  166 root  wheel   166 Nov 27 22:02 share/
drwxr-xr-x    3 root  wheel     3 Oct  2  2014 var/
drwxr-xr-x    4 root  wheel     4 Aug  2 09:26 x86_64-portbld-freebsd10.1/
# pkg info |wc -l
    1072
Comment 1 VK freebsd_triage 2015-12-07 22:16:27 UTC
Thanks for the report.

This actually appears to be happening only on the first run, when there's no database yet. I suspect the culprit is the mysql_install_db.sh invoked on first run and --basedir=/usr/local arg.
Comment 2 Markus Kohlmeyer 2016-05-19 18:12:46 UTC
Created attachment 170490 [details]
fix by adding --keep-my.cnf to mysql_install_db options


Patch adds --keep-my.cnf to mysql_install_db options which avoids the unneeded/unwanted/useless creation of /usr/local/my.cnf
Comment 3 Markus Kohlmeyer 2016-05-19 18:15:10 UTC
Depends on patch for bug #192657
Comment 4 commit-hook freebsd_committer freebsd_triage 2017-01-19 22:30:02 UTC
A commit references this bug:

Author: feld
Date: Thu Jan 19 22:29:06 UTC 2017
New revision: 431919
URL: https://svnweb.freebsd.org/changeset/ports/431919

Log:
  databases/mysql56: Update to 5.6.35

  - Port improvements from MySQL 5.7 port
  - Use system libs instead of bundled
  - Fix many open PRs
  - Change MAINTAINER

  PR:		216244 192657 198812 199751 205093
  PR:		209618 211248 205983 209338

Changes:
  head/databases/mysql56-client/Makefile
  head/databases/mysql56-client/files/patch-CMakeLists.txt
  head/databases/mysql56-client/files/patch-extra_CMakeLists.txt
  head/databases/mysql56-client/files/patch-man_CMakeLists.txt
  head/databases/mysql56-client/files/patch-mysys_ssl_my_default.cc
  head/databases/mysql56-client/files/patch-scripts_CMakeLists.txt
  head/databases/mysql56-client/files/patch-support-files_CMakeLists.txt
  head/databases/mysql56-client/pkg-message
  head/databases/mysql56-server/Makefile
  head/databases/mysql56-server/distinfo
  head/databases/mysql56-server/files/my.cnf.sample.in
  head/databases/mysql56-server/files/mysql-server.in
  head/databases/mysql56-server/files/patch-mysys_ssl_my_default.cc
  head/databases/mysql56-server/pkg-message
  head/databases/mysql56-server/pkg-plist
Comment 5 commit-hook freebsd_committer freebsd_triage 2017-01-26 19:59:31 UTC
A commit references this bug:

Author: brnrd
Date: Thu Jan 26 19:58:06 UTC 2017
New revision: 432535
URL: https://svnweb.freebsd.org/changeset/ports/432535

Log:
  MFH: r431919 r431968 r431975 r432035 r432066 r432458

  databases/mysql56: Update to 5.6.35

  - Port improvements from MySQL 5.7 port
  - Use system libs instead of bundled
  - Fix many open PRs
  - Change MAINTAINER

  PR:		216244 192657 198812 199751 205093
  PR:		209618 211248 205983 209338

  databases/mysql56-server: Rollback rc script changes

  databases/mysql56-server: Do not install my.cnf sample

  An issue was discovered where users of mysql did not have a my.cnf and
  the recent update was causing mysqld to find a sample my.cnf and load
  its parameters. This was causing errors on startup for users of innodb
  as the parameters used to init the database did not match the ones in
  the sample config file it was now reading.

  databases/mysql56-server: Fix build with LibreSSL

    - Fix CMake SSL detection
    - Always set WITH_SSL=${OPENSSLBASE}

  PR:		216311
  Approved by:	Mahdi Moktari <mokhi64@gmail.com> (maintainer)
  Differential Revision:	D9272

  Revert r432035 part 2, it breaks build with openssl from base

  With hat:	portmgr

  databases/mysql56-server: Fix OpenSSL linking

    - Force dynamic linking with OpenSSL

  Approved by:	ports-secteam (feld)

Changes:
_U  branches/2017Q1/
  branches/2017Q1/databases/mysql56-client/Makefile
  branches/2017Q1/databases/mysql56-client/files/patch-CMakeLists.txt
  branches/2017Q1/databases/mysql56-client/files/patch-cmake_ssl.cmake
  branches/2017Q1/databases/mysql56-client/files/patch-extra_CMakeLists.txt
  branches/2017Q1/databases/mysql56-client/files/patch-man_CMakeLists.txt
  branches/2017Q1/databases/mysql56-client/files/patch-mysys_ssl_my_default.cc
  branches/2017Q1/databases/mysql56-client/files/patch-scripts_CMakeLists.txt
  branches/2017Q1/databases/mysql56-client/files/patch-support-files_CMakeLists.txt
  branches/2017Q1/databases/mysql56-client/pkg-message
  branches/2017Q1/databases/mysql56-server/Makefile
  branches/2017Q1/databases/mysql56-server/distinfo
  branches/2017Q1/databases/mysql56-server/files/my.cnf.sample.in
  branches/2017Q1/databases/mysql56-server/files/patch-cmake_ssl.cmake
  branches/2017Q1/databases/mysql56-server/files/patch-mysys_ssl_my_default.cc
  branches/2017Q1/databases/mysql56-server/pkg-message
  branches/2017Q1/databases/mysql56-server/pkg-plist