Lines 11-19
Link Here
|
11 |
# Add the following line to /etc/rc.conf to enable mysql: |
11 |
# Add the following line to /etc/rc.conf to enable mysql: |
12 |
# mysql_enable (bool): Set to "NO" by default. |
12 |
# mysql_enable (bool): Set to "NO" by default. |
13 |
# Set it to "YES" to enable MySQL. |
13 |
# Set it to "YES" to enable MySQL. |
14 |
# mysql_limits (bool): Set to "NO" by default. |
14 |
%%LEGACY_LIMITS%%# mysql_limits (bool): Set to "NO" by default. |
15 |
# Set it to yes to run `limits -e -U mysql` |
15 |
%%LEGACY_LIMITS%%# Set it to yes to run `limits -e -U mysql` |
16 |
# just before mysql starts. |
16 |
%%LEGACY_LIMITS%%# just before mysql starts. |
17 |
# mysql_dbdir (str): Default to "%%MY_DBDIR%%" |
17 |
# mysql_dbdir (str): Default to "%%MY_DBDIR%%" |
18 |
# Base database directory. |
18 |
# Base database directory. |
19 |
# mysql_confdir (str): Default to "%%ETCDIR%%" |
19 |
# mysql_confdir (str): Default to "%%ETCDIR%%" |
Lines 36-42
rcvar=mysql_enable
Link Here
|
36 |
load_rc_config $name |
36 |
load_rc_config $name |
37 |
|
37 |
|
38 |
: ${mysql_enable="NO"} |
38 |
: ${mysql_enable="NO"} |
39 |
: ${mysql_limits="NO"} |
39 |
%%LEGACY_LIMITS%%: ${mysql_limits="NO"} |
40 |
: ${mysql_dbdir="%%MY_DBDIR%%"} |
40 |
: ${mysql_dbdir="%%MY_DBDIR%%"} |
41 |
: ${mysql_confdir="%%ETCDIR%%"} |
41 |
: ${mysql_confdir="%%ETCDIR%%"} |
42 |
if [ -f "${mysql_confdir}/my.cnf" ]; then |
42 |
if [ -f "${mysql_confdir}/my.cnf" ]; then |
Lines 47-58
fi
Link Here
|
47 |
if [ ! -z "${mysql_optfile}" ]; then |
47 |
if [ ! -z "${mysql_optfile}" ]; then |
48 |
mysql_extra="--defaults-extra-file=${mysql_optfile}" |
48 |
mysql_extra="--defaults-extra-file=${mysql_optfile}" |
49 |
fi |
49 |
fi |
50 |
if [ "${mysql_limits}" = "NO" ]; then |
|
|
51 |
mysql_limits="" |
52 |
fi |
53 |
|
50 |
|
54 |
mysql_user="mysql" |
51 |
mysql_user="mysql" |
55 |
mysql_limits_args="-e -U ${mysql_user}" |
52 |
%%LEGACY_LIMITS%%mysql_limits_args="-e -U ${mysql_user}" |
56 |
: ${hostname:=`/bin/hostname`} |
53 |
: ${hostname:=`/bin/hostname`} |
57 |
pidfile=${mysql_pidfile:-"${mysql_dbdir}/${hostname}.pid"} |
54 |
pidfile=${mysql_pidfile:-"${mysql_dbdir}/${hostname}.pid"} |
58 |
command="/usr/sbin/daemon" |
55 |
command="/usr/sbin/daemon" |
Lines 74-84
mysql_prestart()
Link Here
|
74 |
if [ ! -d "${mysql_dbdir}/mysql/." ]; then |
71 |
if [ ! -d "${mysql_dbdir}/mysql/." ]; then |
75 |
mysql_create_auth_tables || return 1 |
72 |
mysql_create_auth_tables || return 1 |
76 |
fi |
73 |
fi |
77 |
if [ -z "$mysql_limits" ] || checkyesno mysql_limits; then |
74 |
%%LEGACY_LIMITS%% if checkyesno mysql_limits; then |
78 |
eval `/usr/bin/limits ${mysql_limits_args}` 2>/dev/null |
75 |
%%LEGACY_LIMITS%% eval `/usr/bin/limits ${mysql_limits_args}` 2>/dev/null |
79 |
else |
76 |
%%LEGACY_LIMITS%% else |
80 |
return 0 |
77 |
%%LEGACY_LIMITS%% return 0 |
81 |
fi |
78 |
%%LEGACY_LIMITS%% fi |
|
|
79 |
%%MODERN_LIMITS%% return 0 |
82 |
} |
80 |
} |
83 |
|
81 |
|
84 |
mysql_poststart() |
82 |
mysql_poststart() |