summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2012-10-29 22:56:39 (GMT)
committerJames Meyer <james.meyer@operamail.com>2012-10-29 22:56:39 (GMT)
commitf974db507d6236cb82d3daf31073fcfe82bcf2ed (patch)
tree203c053dc7c885b99855143d56348ace68a181d2
parent5027ed542f9e59dad7d03bae8832527c9b01e9cb (diff)
downloadlinhes_pkgbuild-f974db507d6236cb82d3daf31073fcfe82bcf2ed.zip
linhes_pkgbuild-f974db507d6236cb82d3daf31073fcfe82bcf2ed.tar.gz
linhes_pkgbuild-f974db507d6236cb82d3daf31073fcfe82bcf2ed.tar.bz2
runit-scripts: make mythbackend wait on mysql. mysql must be up for at least 5 seconds.
mysql add a bash signal trap so that mysql will shut down correctly. Without this mysql ignores the term signal which makes it unique in the unix world.
-rwxr-xr-xabs/core/runit-scripts/PKGBUILD2
-rwxr-xr-xabs/core/runit-scripts/runitscripts/services/mysql/run7
-rwxr-xr-xabs/core/runit-scripts/runitscripts/services/mythbackend/run3
3 files changed, 10 insertions, 2 deletions
diff --git a/abs/core/runit-scripts/PKGBUILD b/abs/core/runit-scripts/PKGBUILD
index 581bf06..83530fe 100755
--- a/abs/core/runit-scripts/PKGBUILD
+++ b/abs/core/runit-scripts/PKGBUILD
@@ -1,6 +1,6 @@
pkgname=runit-scripts
pkgver=2.1.1
-pkgrel=77
+pkgrel=78
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 e9dc6f6..f078c87 100755
--- a/abs/core/runit-scripts/runitscripts/services/mysql/run
+++ b/abs/core/runit-scripts/runitscripts/services/mysql/run
@@ -35,5 +35,10 @@ if [ ! -d /var/run/mysqld ]; then
mkdir -p /var/run/mysqld
chown mysql /var/run/mysqld
fi
-exec /usr/bin/mysqld_safe --user=mysql &>/dev/null
+HOME=/etc/mysql/
+MYSQLADMIN='/usr/bin/mysqladmin'
+trap "$MYSQLADMIN shutdown" 0
+trap 'exit 2' 1 2 3 15
+
+/usr/bin/mysqld_safe --user=mysql & wait
diff --git a/abs/core/runit-scripts/runitscripts/services/mythbackend/run b/abs/core/runit-scripts/runitscripts/services/mythbackend/run
index 26dca04..937b267 100755
--- a/abs/core/runit-scripts/runitscripts/services/mythbackend/run
+++ b/abs/core/runit-scripts/runitscripts/services/mythbackend/run
@@ -4,6 +4,9 @@ exec 2>&1
export TERM=linux
. /etc/rc.conf
. /etc/rc.d/functions
+#wait for mysql
+/sbin/svwaitup -s 5 /service/mysql
+
#profile is here to setup LC_ALL/locale
MYTH_RUN_STATUS="1"
. /etc/profile