svn commit: r316439 - in head/databases: mysql55-server/files mysql56-server/files

Chris Rees crees at FreeBSD.org
Wed Apr 24 17:08:20 UTC 2013


On 24 April 2013 16:08, Alex Dupre <ale at freebsd.org> wrote:
> XXX Ports RC script present
> XXX Ports RC script present
> Author: ale
> Date: Wed Apr 24 15:08:22 2013
> New Revision: 316439
> URL: http://svnweb.freebsd.org/changeset/ports/316439
>
> Log:
>   Allow to specify server-specific option file path in /etc/rc.conf
>
>   PR:           ports/172408  http://www.FreeBSD.org/cgi/query-pr.cgi?pr=172408
>   Submitted by: Daniel Ylitalo <daniel at produktion203.se>
>
> Modified:
>   head/databases/mysql55-server/files/mysql-server.in
>   head/databases/mysql56-server/files/mysql-server.in
>
> Modified: head/databases/mysql55-server/files/mysql-server.in
> ==============================================================================
> --- head/databases/mysql55-server/files/mysql-server.in Wed Apr 24 14:21:12 2013        (r316438)
> +++ head/databases/mysql55-server/files/mysql-server.in Wed Apr 24 15:08:22 2013        (r316439)
> @@ -16,6 +16,8 @@
>  #                      just before mysql starts.
>  # mysql_dbdir (str):   Default to "/var/db/mysql"
>  #                      Base database directory.
> +# mysql_optfile (str): Server-specific option file.
> +#                      Default to "${mysql_dbdir}/my.cnf".
>  # mysql_pidfile (str): Custum PID file path and name.
>  #                      Default to "${mysql_dbdir}/${hostname}.pid".
>  # mysql_args (str):    Custom additional arguments to be passed
> @@ -32,12 +34,13 @@ load_rc_config $name
>  : ${mysql_enable="NO"}
>  : ${mysql_limits="NO"}
>  : ${mysql_dbdir="/var/db/mysql"}
> +: ${mysql_optfile="${mysql_dbdir}/my.cnf"}
>
>  mysql_user="mysql"
>  mysql_limits_args="-e -U ${mysql_user}"
>  pidfile=${mysql_pidfile:-"${mysql_dbdir}/`/bin/hostname`.pid"}

This is fairly slow for executing every time the script is included,
can I suggest replacing the preceding pidfile line with:

: ${hostname:=`hostname`}
pidfile=${mysql_pidfile:-"${mysql_dbdir}/${hostname}.pid"}

?

The majority of users will have set hostname in rc.conf, so this means
that the call to the hostname binary is redundant.

Chris


More information about the svn-ports-head mailing list