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 "/var/db/mysql" |
17 |
# mysql_dbdir (str): Default to "/var/db/mysql" |
18 |
# Base database directory. |
18 |
# Base database directory. |
19 |
# mysql_optfile (str): Server-specific option file. |
19 |
# mysql_optfile (str): Server-specific option file. |
Lines 32-43
rcvar=mysql_enable
Link Here
|
32 |
load_rc_config $name |
32 |
load_rc_config $name |
33 |
|
33 |
|
34 |
: ${mysql_enable="NO"} |
34 |
: ${mysql_enable="NO"} |
35 |
: ${mysql_limits="NO"} |
35 |
%%LEGACY_LIMITS%%: ${mysql_limits="NO"} |
36 |
: ${mysql_dbdir="/var/db/mysql"} |
36 |
: ${mysql_dbdir="/var/db/mysql"} |
37 |
: ${mysql_optfile="${mysql_dbdir}/my.cnf"} |
37 |
: ${mysql_optfile="${mysql_dbdir}/my.cnf"} |
38 |
|
38 |
|
39 |
mysql_user="mysql" |
39 |
mysql_user="mysql" |
40 |
mysql_limits_args="-e -U ${mysql_user}" |
40 |
%%LEGACY_LIMITS%%mysql_limits_args="-e -U ${mysql_user}" |
41 |
: ${hostname:=`/bin/hostname`} |
41 |
: ${hostname:=`/bin/hostname`} |
42 |
pidfile=${mysql_pidfile:-"${mysql_dbdir}/${hostname}.pid"} |
42 |
pidfile=${mysql_pidfile:-"${mysql_dbdir}/${hostname}.pid"} |
43 |
command="/usr/sbin/daemon" |
43 |
command="/usr/sbin/daemon" |
Lines 59-69
mysql_prestart()
Link Here
|
59 |
if [ ! -d "${mysql_dbdir}/mysql/." ]; then |
59 |
if [ ! -d "${mysql_dbdir}/mysql/." ]; then |
60 |
mysql_create_auth_tables || return 1 |
60 |
mysql_create_auth_tables || return 1 |
61 |
fi |
61 |
fi |
62 |
if checkyesno mysql_limits; then |
62 |
%%LEGACY_LIMITS%% if checkyesno mysql_limits; then |
63 |
eval `/usr/bin/limits ${mysql_limits_args}` 2>/dev/null |
63 |
%%LEGACY_LIMITS%% eval `/usr/bin/limits ${mysql_limits_args}` 2>/dev/null |
64 |
else |
64 |
%%LEGACY_LIMITS%% else |
65 |
return 0 |
65 |
%%LEGACY_LIMITS%% return 0 |
66 |
fi |
66 |
%%LEGACY_LIMITS%% fi |
|
|
67 |
%%MODERN_LIMITS%% return 0 |
67 |
} |
68 |
} |
68 |
|
69 |
|
69 |
mysql_poststart() |
70 |
mysql_poststart() |