summaryrefslogtreecommitdiffstats
path: root/extra/mysql/mysql.initd
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-03-24 16:13:34 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-03-24 16:13:34 +0000
commit6626f516085625e2b18ef7f3cb8a5a856198f4d4 (patch)
treed7f7b23a75b67fd2246ab3e49ebaba799a8ce82c /extra/mysql/mysql.initd
parent230a508173a4ee5d9c890f2694cf8cac65ded822 (diff)
downloadaports-6626f516085625e2b18ef7f3cb8a5a856198f4d4.tar.bz2
aports-6626f516085625e2b18ef7f3cb8a5a856198f4d4.tar.xz
extra/mysql: moved from testing
seems to work
Diffstat (limited to 'extra/mysql/mysql.initd')
-rw-r--r--extra/mysql/mysql.initd38
1 files changed, 38 insertions, 0 deletions
diff --git a/extra/mysql/mysql.initd b/extra/mysql/mysql.initd
new file mode 100644
index 00000000..8f841646
--- /dev/null
+++ b/extra/mysql/mysql.initd
@@ -0,0 +1,38 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/www/viewcvs.gentoo.org/raw_cvs/gentoo-x86/dev-db/mysql/files/mysql.init,v 1.7 2004/07/14 21:41:15 agriffis Exp $
+
+depend() {
+ need net
+ use dns
+}
+
+checkconfig() {
+ if [ ! -f /etc/mysql/my.cnf ] ; then
+ eerror "No /etc/mysql/my.cnf file exists!"
+ fi
+
+ dir=`my_print_defaults -c /etc/mysql/my.cnf mysqld | grep -- --datadir | sed -e "s|^.*=\(.*\)|\1|"`
+
+ if [ ! -d $dir/mysql ] ; then
+ eerror "You dont appear to have the mysql database installed yet."
+ eerror "Please run /usr/bin/mysql_install_db --user=mysql to have this done..."
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting mysqld"
+ /usr/bin/mysqld_safe --defaults-file=/etc/mysql/my.cnf >/dev/null 2>&1 &
+ eend $?
+}
+
+stop () {
+ ebegin "Stopping mysqld"
+ start-stop-daemon --stop --quiet \
+ --pidfile=/var/run/mysqld/mysqld.pid --retry 20
+ eend $?
+}
+