|
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 34-40
rcvar=mysql_enable
Link Here
|
| 34 |
load_rc_config $name |
34 |
load_rc_config $name |
| 35 |
|
35 |
|
| 36 |
: ${mysql_enable="NO"} |
36 |
: ${mysql_enable="NO"} |
| 37 |
: ${mysql_limits="NO"} |
37 |
%%LEGACY_LIMITS%%: ${mysql_limits="NO"} |
| 38 |
: ${mysql_dbdir="%%MY_DBDIR%%"} |
38 |
: ${mysql_dbdir="%%MY_DBDIR%%"} |
| 39 |
: ${mysql_confdir="%%ETCDIR%%"} |
39 |
: ${mysql_confdir="%%ETCDIR%%"} |
| 40 |
if [ -f "${mysql_dbdir}/my.cnf" ]; then |
40 |
if [ -f "${mysql_dbdir}/my.cnf" ]; then |
|
Lines 44-50
else
Link Here
|
| 44 |
fi |
44 |
fi |
| 45 |
|
45 |
|
| 46 |
mysql_user="mysql" |
46 |
mysql_user="mysql" |
| 47 |
mysql_limits_args="-e -U ${mysql_user}" |
47 |
%%LEGACY_LIMITS%%mysql_limits_args="-e -U ${mysql_user}" |
| 48 |
: ${hostname:=`/bin/hostname`} |
48 |
: ${hostname:=`/bin/hostname`} |
| 49 |
pidfile=${mysql_pidfile:-"${mysql_dbdir}/${hostname}.pid"} |
49 |
pidfile=${mysql_pidfile:-"${mysql_dbdir}/${hostname}.pid"} |
| 50 |
command="/usr/sbin/daemon" |
50 |
command="/usr/sbin/daemon" |
|
Lines 76-86
mysql_prestart()
Link Here
|
| 76 |
if [ ! -d "${mysql_dbdir}/mysql" ]; then |
76 |
if [ ! -d "${mysql_dbdir}/mysql" ]; then |
| 77 |
mysql_create_auth_tables || return 1 |
77 |
mysql_create_auth_tables || return 1 |
| 78 |
fi |
78 |
fi |
| 79 |
if checkyesno mysql_limits; then |
79 |
%%LEGACY_LIMITS%% if checkyesno mysql_limits; then |
| 80 |
eval `/usr/bin/limits ${mysql_limits_args}` 2>/dev/null |
80 |
%%LEGACY_LIMITS%% eval `/usr/bin/limits ${mysql_limits_args}` 2>/dev/null |
| 81 |
else |
81 |
%%LEGACY_LIMITS%% else |
| 82 |
return 0 |
82 |
%%LEGACY_LIMITS%% return 0 |
| 83 |
fi |
83 |
%%LEGACY_LIMITS%% fi |
|
|
84 |
%%MODERN_LIMITS%% return 0 |
| 84 |
} |
85 |
} |
| 85 |
|
86 |
|
| 86 |
mysql_poststart() |
87 |
mysql_poststart() |