Message ID | 1393944603-3104-3-git-send-email-kuyurix@gmail.com |
---|---|
State | Accepted |
Headers | show |
Dear Marcelo Gutiérrez, On Tue, 4 Mar 2014 14:50:02 +0000, Marcelo Gutiérrez wrote: > +case "$1" in > + start) > + /usr/bin/mysqld_safe & I've added a call to mysql_install_db on the first boot, to generate the MySQL system tables, otherwise the server refuses to start. I've also used --pid-file when calling mysqld_safe to explicitly specify where the pid file should be stored, because... > + ;; > + stop) > + if test -f /var/lib/mysql/mysqld.pid ; then > + PID=`cat /var/lib/mysql/mysqld.pid` ... it wasn't stored there, so I fixed that up as well. Committed with those changes, thanks! Thomas
diff --git a/package/mysql/S97mysqld b/package/mysql/S97mysqld new file mode 100644 index 0000000..91ddb44 --- /dev/null +++ b/package/mysql/S97mysqld @@ -0,0 +1,22 @@ +#!/bin/sh +# +#MySQL init script. +# +case "$1" in + start) + /usr/bin/mysqld_safe & + ;; + stop) + if test -f /var/lib/mysql/mysqld.pid ; then + PID=`cat /var/lib/mysql/mysqld.pid` + kill $PID + fi + ;; + restart) + "$0" stop + "$0" start + ;; + *) + echo "Usage: /etc/init.d/mysqld {start|stop|restart}" + ;; +esac diff --git a/package/mysql/mysql.mk b/package/mysql/mysql.mk index 3b69bdc..c35fef5 100644 --- a/package/mysql/mysql.mk +++ b/package/mysql/mysql.mk @@ -89,6 +89,11 @@ endef MYSQL_POST_INSTALL_TARGET_HOOKS += MYSQL_ADD_FOLDER +define MYSQL_INSTALL_INIT_SYSV + $(INSTALL) -D -m 0755 package/mysql/S97mysqld \ + $(TARGET_DIR)/etc/init.d/S97mysqld +endef + else MYSQL_CONF_OPT += \ --without-server
Signed-off-by: Marcelo Gutiérrez <kuyurix@gmail.com> --- package/mysql/S97mysqld | 22 ++++++++++++++++++++++ package/mysql/mysql.mk | 5 +++++ 2 files changed, 27 insertions(+) create mode 100644 package/mysql/S97mysqld