openbsd-ports/databases/mysql/pkg/mysqld.rc
jasper 1552f48bdc - unbreak rc_stop()
from frantisek holop, ok brad (MAINTAINER)
2010-12-12 20:18:40 +00:00

28 lines
541 B
Bash
Executable File

#!/bin/sh
#
# $OpenBSD: mysqld.rc,v 1.6 2010/12/12 20:18:40 jasper Exp $
. /etc/rc.d/rc.subr
daemon="${TRUEPREFIX}/bin/mysqld_safe"
rc_reload=NO
rc_check() {
${TRUEPREFIX}/bin/mysqladmin -s ping >/dev/null
}
rc_start() {
su -c ${daemon_class:-daemon} -s ${daemon_shell:-/bin/sh} \
${daemon_user:-root} -c "${daemon} ${daemon_flags}" >/dev/null 2>&1 &
}
rc_stop() {
${TRUEPREFIX}/bin/mysqladmin -s shutdown
if [ $? -gt 0 ]; then
pkill -f "^/bin/sh ${daemon}"
pkill -U _mysql -f "^${TRUEPREFIX}/libexec/mysqld"
fi
}
rc_cmd $1