summaryrefslogtreecommitdiffstats
path: root/abs
diff options
context:
space:
mode:
authorBritney Fransen <brfransen@gmail.com>2018-05-28 19:06:17 (GMT)
committerBritney Fransen <brfransen@gmail.com>2018-05-28 19:06:17 (GMT)
commit3d78c42740c266b4efdceda1f410f06cd4ea01f5 (patch)
treeb3135e7c1bcafd6cd48c7cd92ffee15b7befef50 /abs
parentfef5201886c4055e7a0ee6882c8a6df677fc930f (diff)
downloadlinhes_pkgbuild-3d78c42740c266b4efdceda1f410f06cd4ea01f5.zip
linhes_pkgbuild-3d78c42740c266b4efdceda1f410f06cd4ea01f5.tar.gz
linhes_pkgbuild-3d78c42740c266b4efdceda1f410f06cd4ea01f5.tar.bz2
runit-scripts: mysql run: add check of length of .err file
Diffstat (limited to 'abs')
-rwxr-xr-xabs/core/runit-scripts/PKGBUILD2
-rwxr-xr-xabs/core/runit-scripts/runitscripts/services/mysql/run9
2 files changed, 10 insertions, 1 deletions
diff --git a/abs/core/runit-scripts/PKGBUILD b/abs/core/runit-scripts/PKGBUILD
index d762d43..777d89f 100755
--- a/abs/core/runit-scripts/PKGBUILD
+++ b/abs/core/runit-scripts/PKGBUILD
@@ -1,6 +1,6 @@
pkgname=runit-scripts
pkgver=8.5
-pkgrel=1
+pkgrel=2
pkgdesc="collection of startup scripts for runit"
url="http://smarden.org/runit/"
license=('BSD')
diff --git a/abs/core/runit-scripts/runitscripts/services/mysql/run b/abs/core/runit-scripts/runitscripts/services/mysql/run
index de76962..8fad493 100755
--- a/abs/core/runit-scripts/runitscripts/services/mysql/run
+++ b/abs/core/runit-scripts/runitscripts/services/mysql/run
@@ -35,6 +35,15 @@ if [ ! -d /var/run/mysqld ]; then
mkdir -p /var/run/mysqld
chown mysql /var/run/mysqld
fi
+
+#check .err and truncate if more than 30000 lines
+ErrFile="/data/srv/mysql/`hostname`.err"
+if [[ $(wc -l < $ErrFile) -gt 30000 ]]
+then
+ tail -n 30000 "$ErrFile" > "$ErrFile.tmp" && mv "$ErrFile.tmp" "$ErrFile"
+ chown mysql.mysql "$ErrFile"
+fi
+
HOME=/etc/mysql/
MYSQLADMIN='/usr/bin/mysqladmin'