diff options
Diffstat (limited to 'databases/mariadb104-server')
-rw-r--r-- | databases/mariadb104-server/Makefile | 10 | ||||
-rw-r--r-- | databases/mariadb104-server/files/my.cnf.sample.in | 2 | ||||
-rw-r--r-- | databases/mariadb104-server/files/mysql-server.in | 21 | ||||
-rw-r--r-- | databases/mariadb104-server/files/server.cnf.sample.in | 4 |
4 files changed, 25 insertions, 12 deletions
diff --git a/databases/mariadb104-server/Makefile b/databases/mariadb104-server/Makefile index 042837271620..1903bcfbd5c0 100644 --- a/databases/mariadb104-server/Makefile +++ b/databases/mariadb104-server/Makefile @@ -3,7 +3,7 @@ PORTNAME?= mariadb PORTVERSION= 10.4.13 -PORTREVISION?= 3 +PORTREVISION?= 4 CATEGORIES= databases MASTER_SITES= http://mirrors.supportex.net/${SITESDIR}/ \ http://mirror2.hs-esslingen.de/pub/Mirrors/${SITESDIR}/ \ @@ -42,6 +42,7 @@ MARIADB_USER?= mysql MARIADB_GROUP?= mysql MARIADB_RUNDIR?= /var/run/mysql +MARIADB_SOCK?= mysql.sock MARIADB_LOGDIR?= /var/log/mysql OPTIONS_SINGLE= GSSAPI @@ -93,7 +94,7 @@ CMAKE_ARGS+= -DINSTALL_DOCDIR="share/doc/mysql" \ -DINSTALL_SUPPORTFILESDIR="share/mysql" \ -DDEFAULT_SYSCONFDIR="${PREFIX}/etc" \ -DDEFAULT_SYSCONF2DIR="${ETCDIR}/conf.d" \ - -DINSTALL_UNIX_ADDRDIR="${MARIADB_RUNDIR}" \ + -DINSTALL_UNIX_ADDRDIR="${MARIADB_RUNDIR}/${MARIADB_SOCK}" \ -DWITH_SSL="${OPENSSLBASE}" \ -DCURSES_CURSES_LIBRARY="/usr/lib/libcurses.so" \ -DCURSES_FORM_LIBRARY="/usr/lib/libform.so" \ @@ -122,7 +123,8 @@ GSSAPI_MIT_USES= gssapi:mit GSSAPI_NONE_CMAKE_ON= -DPLUGIN_AUTH_GSSAPI_CLIENT=OFF OPTIONS_SUB= yes SUB_LIST+= MARIADB_USER="${MARIADB_USER}" \ - MARIADB_RUNDIR="${MARIADB_RUNDIR}" + MARIADB_RUNDIR="${MARIADB_RUNDIR}" \ + MARIADB_SOCK="${MARIADB_SOCK}" PLIST_SUB+= MARIADB_USER="${MARIADB_USER}" \ MARIADB_GROUP="${MARIADB_GROUP}" @@ -139,6 +141,8 @@ PLIST_SUB+= MARIADB_RUNDIR="${MARIADB_RUNDIR}" USES+= mysql:104m USE_LDCONFIG+= ${PREFIX}/lib/mysql/plugin USE_RC_SUBR= mysql-server +USERS= ${MARIADB_USER} +GROUPS= ${MARIADB_GROUP} CMAKE_ON+= CMAKE_SKIP_BUILD_RPATH WITH_EMBEDDED_SERVER CMAKE_OFF+= WITH_CLIENT SUB_FILES+= server.cnf.sample diff --git a/databases/mariadb104-server/files/my.cnf.sample.in b/databases/mariadb104-server/files/my.cnf.sample.in index 0426f1313556..15dbc7e64da8 100644 --- a/databases/mariadb104-server/files/my.cnf.sample.in +++ b/databases/mariadb104-server/files/my.cnf.sample.in @@ -5,7 +5,7 @@ # [client-server] port = 3306 -socket = %%MARIADB_RUNDIR%%/mysql.sock +socket = %%MARIADB_RUNDIR%%/%%MARIADB_SOCK%% # # include *.cnf from the config directory diff --git a/databases/mariadb104-server/files/mysql-server.in b/databases/mariadb104-server/files/mysql-server.in index 8c01fa0bd333..3f0fa99d4ad6 100644 --- a/databases/mariadb104-server/files/mysql-server.in +++ b/databases/mariadb104-server/files/mysql-server.in @@ -12,14 +12,17 @@ %%LEGACY_LIMITS%%# mysql_(instance_)?limits (bool): Set to "NO" by default. %%LEGACY_LIMITS%%# Set it to yes to run `limits -e -U mysql` %%LEGACY_LIMITS%%# just before mysql starts. -# mysql_(instance_)?dbdir (str): Default to "/var/db/mysql" -# Base database directory. +# mysql_(instance_)?dbdir (str): Base database directory. +# Default to "/var/db/mysql" # mysql_(instance_)?args (str): Custom additional arguments to be passed # to mysqld_safe (default empty). # mysql_(instance_)?pidfile (str): Custum PID file path and name. # Default to "${mysql_dbdir}/${hostname}.pid". -# mysql_(instance_)?user (str): User to run mysqld as -# Default to "mysql" created by the port +# mysql_(instance_)?user (str): User to run mysqld as. +# Default to "%%MARIADB_USER%%" created by the port +# mysql_(instance_)?socket (str): Name of the socket file. +# Default to "" and used from %%ETCDIR%%/my.cnf, +# where default is "%%MARIADB_RUNDIR%%/%%MARIADB_SOCK%%". # mysql_(instance_)?optfile (str): Server-specific option file. # Default to "${mysql_dbdir}/my.cnf". # mysql_instances (str): Set to "" by default. @@ -34,7 +37,7 @@ load_rc_config $name : ${mysql_enable="NO"} %%LEGACY_LIMITS%%: ${mysql_limits="NO"} -: ${mysql_user="mysql"} +: ${mysql_user="%%MARIADB_USER%%"} %%LEGACY_LIMITS%%mysql_limits_args="-e -U ${mysql_user}" : ${mysql_dbdir="/var/db/mysql"} : ${mysql_optfile="${mysql_dbdir}/my.cnf"} @@ -54,6 +57,7 @@ if [ -n "$2" ]; then %%LEGACY_LIMITS%%eval mysql_limits="\${mysql_${instance}_limits:-\"${mysql_limits}\"}" eval mysql_user="\${mysql_${instance}_user:-\"${mysql_user}\"}" %%LEGACY_LIMITS%%eval mysql_limits_args="\${mysql_${instance}_limits_args:-\"-e -U $mysql_user\"}" + eval mysql_socket="\${mysql_${instance}_socket:-\"${mysql_socket}\"}" eval mysql_optfile="\${mysql_${instance}_optfile:-\"${mysql_dbdir}/my.cnf\"}" eval mysql_pidfile="\${mysql_${instance}_pidfile:-\"${mysql_dbdir}/`/bin/hostname`.pid\"}" ;; @@ -99,7 +103,7 @@ fi pidfile=$mysql_pidfile mysql_install_db="%%PREFIX%%/bin/mysql_install_db" mysql_install_db_args="--basedir=%%PREFIX%% --datadir=${mysql_dbdir} --force" -command_args="-c -f %%PREFIX%%/bin/mysqld_safe --defaults-extra-file=${mysql_optfile} --user=${mysql_user} --datadir=${mysql_dbdir} --pid-file=${pidfile} ${mysql_args}" +command_args="-c -f %%PREFIX%%/bin/mysqld_safe --defaults-extra-file=${mysql_optfile} --user=${mysql_user} --datadir=${mysql_dbdir} --pid-file=${pidfile} ${mysql_socket:+--socket=${mysql_socket}} ${mysql_args}" mysql_create_auth_tables() { @@ -119,6 +123,11 @@ mysql_prestart() if [ ! -d "${mysql_dbdir}/mysql/." ]; then mysql_create_auth_tables || return 1 fi + [ "${mysql_socket}" = "" ] && mysql_rundir="%%MARIADB_RUNDIR%%" || mysql_rundir="`/usr/bin/dirname ${mysql_socket}`" + if [ ! -d "${mysql_rundir}" ]; then + install -d -o ${mysql_user} -g %%MARIADB_GROUP%% "${mysql_rundir}" + + fi %%LEGACY_LIMITS%% if checkyesno mysql_limits; then %%LEGACY_LIMITS%% eval `/usr/bin/limits ${mysql_limits_args}` 2>/dev/null %%LEGACY_LIMITS%% else diff --git a/databases/mariadb104-server/files/server.cnf.sample.in b/databases/mariadb104-server/files/server.cnf.sample.in index 26a49f6236af..c08ce7461ed2 100644 --- a/databases/mariadb104-server/files/server.cnf.sample.in +++ b/databases/mariadb104-server/files/server.cnf.sample.in @@ -14,12 +14,12 @@ [mysqld] user = %%MARIADB_USER%% # port = 3306 # inherited from %%ETCDIR%%/my.cnf -# socket = %%MARIADB_RUNDIR%%/mysql.sock # inherited from %%ETCDIR%%/my.cnf +# socket = %%MARIADB_RUNDIR%%/%%MARIADB_SOCK%% # inherited from %%ETCDIR%%/my.cnf bind-address = 127.0.0.1 basedir = %%PREFIX%% datadir = /var/db/mysql net_retry_count = 16384 -log_error = %%MARIADB_LOGDIR%%/${hostname}.err +log_error = %%MARIADB_LOGDIR%%/mysqld.err # [mysqld] configuration for ZFS # From https://www.percona.com/resources/technical-presentations/zfs-mysql-percona-technical-webinar # Create separate datasets for data and logs, eg |