2010-11-09 03:55:32 -05:00
|
|
|
#!/bin/sh
|
2010-11-09 03:58:06 -05:00
|
|
|
#
|
2010-12-12 15:18:40 -05:00
|
|
|
# $OpenBSD: mysqld.rc,v 1.6 2010/12/12 20:18:40 jasper Exp $
|
2010-11-09 03:55:32 -05:00
|
|
|
|
|
|
|
. /etc/rc.d/rc.subr
|
|
|
|
|
2010-12-11 03:48:24 -05:00
|
|
|
daemon="${TRUEPREFIX}/bin/mysqld_safe"
|
2010-12-11 07:57:37 -05:00
|
|
|
rc_reload=NO
|
2010-11-09 03:55:32 -05:00
|
|
|
|
|
|
|
rc_check() {
|
|
|
|
${TRUEPREFIX}/bin/mysqladmin -s ping >/dev/null
|
|
|
|
}
|
|
|
|
|
|
|
|
rc_start() {
|
2010-12-11 04:59:25 -05:00
|
|
|
su -c ${daemon_class:-daemon} -s ${daemon_shell:-/bin/sh} \
|
|
|
|
${daemon_user:-root} -c "${daemon} ${daemon_flags}" >/dev/null 2>&1 &
|
2010-11-09 03:55:32 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
rc_stop() {
|
|
|
|
${TRUEPREFIX}/bin/mysqladmin -s shutdown
|
|
|
|
if [ $? -gt 0 ]; then
|
|
|
|
pkill -f "^/bin/sh ${daemon}"
|
2010-12-12 15:18:40 -05:00
|
|
|
pkill -U _mysql -f "^${TRUEPREFIX}/libexec/mysqld"
|
2010-11-09 03:55:32 -05:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
rc_cmd $1
|