openbsd-ports/databases/mysql/pkg/mysqld.rc

28 lines
541 B
Plaintext
Raw Normal View History

2010-11-09 03:55:32 -05:00
#!/bin/sh
#
# $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
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}"
pkill -U _mysql -f "^${TRUEPREFIX}/libexec/mysqld"
2010-11-09 03:55:32 -05:00
fi
}
rc_cmd $1