Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=xfcetesting.git;a=commitdiff;h=8649c0e1064bf9946ff7b11e345d27566eed76e1
commit 8649c0e1064bf9946ff7b11e345d27566eed76e1 Author: James Buren <[email protected]> Date: Sun Jul 8 17:39:45 2012 -0500 mysql-5.5.25-2-x86_64 * convert to systemd schema diff --git a/source/apps-extra/mysql/FrugalBuild b/source/apps-extra/mysql/FrugalBuild index 8bd9851..820f980 100644 --- a/source/apps-extra/mysql/FrugalBuild +++ b/source/apps-extra/mysql/FrugalBuild @@ -3,7 +3,7 @@ pkgname=mysql pkgver=5.5.25 -pkgrel=1 +pkgrel=2 extrapkgver= pkgdesc="A fast SQL database server" url="http://www.mysql.com/" @@ -18,9 +18,9 @@ archs=('i686' 'x86_64' 'arm') up2date="lynx -dump http://dev.mysql.com/downloads/rss.php|grep -i mysql.*server.*ga|sed 's/.* (\(.*\) GA.*/\1/'|Fsort|tail -n 1" mirror="ftp://ftp.crysys.hu/pub/mysql/" source=($mirror/Downloads/MySQL-5.5/$pkgname-$pkgver$extrapkgver.tar.gz \ - rc.mysqld my.cnf mysqld \ + rc.mysqld my.cnf mysqld.service mysql_wait \ fix-non-portable-code-client-plugin.patch) -signatures=($source.asc '' '' '' '') +signatures=($source.asc '' '' '' '' '') subpkgs=('libmysqlclient' 'libmysqld') subdescs=('MySQL client library.' 'Embedded MySQL Server Library') @@ -28,6 +28,10 @@ subdepends=('openssl>=1.0.0 zlib' 'libstdc++ openssl>=1.0.0 zlib libaio') subgroups=('lib' 'lib-extra') subarchs=('i686 x86_64 arm' 'i686 x86_64 arm') +_F_sysvinit_units=(mysqld) +_F_systemd_units=(mysqld=) +Finclude systemd + build() { if [ "$CARCH" == "x86_64" ]; then @@ -64,10 +68,18 @@ build() d $Flocalstatedir/run/mysql 0755 mysql mysql - EOF + Fmkdir /var/lib/mysql /var/log/mysql + Fdirschown /var/lib/mysql 27 27 + Fdirschown /var/log/mysql 27 27 + Fsplit libmysqlclient usr/lib/libmysqlclient* usr/include/mysql - + Fsplit libmysqld usr/lib/libmysqld.a Fsplit libmysqld usr/bin/*_embedded + + Fexe /usr/bin/mysql_wait + Ffile /lib/systemd/system/mysqld.service + Fgenscriptlet } # optimization ok diff --git a/source/apps-extra/mysql/my.cnf b/source/apps-extra/mysql/my.cnf index 0d1d297..d583aa1 100644 --- a/source/apps-extra/mysql/my.cnf +++ b/source/apps-extra/mysql/my.cnf @@ -39,7 +39,7 @@ myisam_sort_buffer_size = 8M # All interaction with mysqld must be made via Unix sockets or named pipes. # Note that using this option without enabling named pipes on Windows # (via the "enable-named-pipe" option) will render mysqld useless! -# +# #skip-networking # Replication Master Server (default) @@ -107,7 +107,7 @@ server-id = 1 #log-bin # Point the following paths to different dedicated disks -#tmpdir = /tmp/ +#tmpdir = /tmp/ #log-update = /path-to-dedicated-directory/hostname # Uncomment the following if you are using BDB tables @@ -129,6 +129,10 @@ server-id = 1 #innodb_flush_log_at_trx_commit = 1 #innodb_lock_wait_timeout = 50 +[mysqld_safe] +log-error=/var/log/mysql/mysqld.log +pid-file=/var/run/mysql/mysqld.pid + [mysqldump] quick max_allowed_packet = 16M diff --git a/source/apps-extra/mysql/mysql_wait b/source/apps-extra/mysql/mysql_wait new file mode 100644 index 0000000..634a81e --- /dev/null +++ b/source/apps-extra/mysql/mysql_wait @@ -0,0 +1,15 @@ +#!/bin/sh + +TIMEOUT=30 +RETURN=1 + +for i in `seq 1 $TIMEOUT`; do + response=`/usr/bin/mysqladmin -u UNKNOWN_USER ping 2> /dev/null` + if [ "$response" = "mysqld is alive" ]; then + RETURN=0 + break + fi + sleep 1 +done + +exit $RETURN diff --git a/source/apps-extra/mysql/mysqld b/source/apps-extra/mysql/mysqld deleted file mode 100644 index c7923a2..0000000 --- a/source/apps-extra/mysql/mysqld +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -MYSQL_OPTS="--log-bin=/var/lib/mysql/`hostname`-bin --pid-file=/var/run/mysql/mysqld.pid" diff --git a/source/apps-extra/mysql/mysqld.service b/source/apps-extra/mysql/mysqld.service new file mode 100644 index 0000000..ce86a23 --- /dev/null +++ b/source/apps-extra/mysql/mysqld.service @@ -0,0 +1,14 @@ +[Unit] +Description=MySQL Daemon +After=network.target + +[Service] +User=mysql +Group=mysql +ExecStartPre=/usr/bin/mysql_install_db --basedir=/usr --log-bin=/var/lib/mysql/$HOSTNAME-bin +ExecStart=/usr/bin/mysqld_safe --basedir=/usr --log-bin=/var/lib/mysql/$HOSTNAME-bin +ExecStartPost=/usr/bin/mysql_wait +Type=simple + +[Install] +WantedBy=multi-user.target _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
