Bug 240949

Summary: databases/mysql57-server subtle start script issue
Product: Ports & Packages Reporter: PK1048 <freebsd>
Component: Individual Port(s)Assignee: Jochen Neumeister <joneum>
Status: Open ---    
Severity: Affects Only Me CC: chris
Priority: --- Flags: bugzilla: maintainer-feedback? (joneum)
Version: Latest   
Hardware: Any   
OS: Any   

Description PK1048 2019-09-30 19:47:32 UTC
The pkg-message states:

MySQL57 has a default %%ETCDIR%%/my.cnf,
remember to replace it wit your own
or set `mysql_optfile="$YOUR_CNF_FILE` in rc.conf.

And the /usr/local/etc/rc.d/mysql-server script states:

# mysql_optfile (str):  Server-specific option file.
#                       Set it in the rc.conf or default behaviour of
#                       `mysqld_safe` itself, will be picking
#                       ${mysql_confdir}/my.cnf if it exists.

But setting mysql_optfile in /etc/rc.conf does not replace the default my.cnf file, instead it sets the mysqld_safe --defaults-extra-file parameter, which is invoked as well as the default from /usr/local/etc/mysql/my.cnf.

Either make the pkg-message and comment in the rc.d script clear that both are invoked or set the mysqld_safe --defaults-file parameter instead of --defaults-extra-file.

From the mysqld_safe man page:

       o   --defaults-extra-file=file_name

           Read this option file in addition to the usual option files. If the
           file does not exist or is otherwise inaccessible, the server will
           exit with an error.  file_name is interpreted relative to the
           current directory if given as a relative path name rather than a
           full path name. This must be the first option on the command line
           if it is used.

           For additional information about this and other option-file
           options, see Section 4.2.2.3, "Command-Line Options that Affect
           Option-File Handling".

       o   --defaults-file=file_name

           Use only the given option file. If the file does not exist or is
           otherwise inaccessible, the server will exit with an error.
           file_name is interpreted relative to the current directory if given
           as a relative path name rather than a full path name. This must be
           the first option on the command line if it is used.

           For additional information about this and other option-file
           options, see Section 4.2.2.3, "Command-Line Options that Affect
           Option-File Handling".
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2020-01-25 03:05:35 UTC
^Triage: Assign to new maintainer (ports r523992)