From 3202a396e855bfcc02a639d9b9cefd6bc44f1c40 Mon Sep 17 00:00:00 2001
From: James Meyer <james.meyer@operamail.com>
Date: Thu, 1 Nov 2012 15:51:19 -0500
Subject: runit-scripts:  added zoneminder Added some svwait mysql for
 mythbackend and zoneminder added myth_run_status=1  for all other scripts
 that use /etc/profile

refs #857
---
 abs/core/runit-scripts/PKGBUILD                    |  2 +-
 .../runit-scripts/runitscripts/services/Xvfb/run   |  1 +
 .../runit-scripts/runitscripts/services/acpid/run  |  3 ++-
 .../runitscripts/services/evrouter/run             |  1 +
 .../runitscripts/services/msg_daemon/run           |  1 +
 .../runit-scripts/runitscripts/services/mysql/run  |  3 ++-
 .../runitscripts/services/mythbackend/run          |  7 +-----
 .../runit-scripts/runitscripts/services/ntpd/run   |  2 +-
 .../runitscripts/services/zoneminder/finish        |  5 ++++
 .../runitscripts/services/zoneminder/run           | 28 ++++++++++++++++++++++
 10 files changed, 43 insertions(+), 10 deletions(-)
 create mode 100755 abs/core/runit-scripts/runitscripts/services/zoneminder/finish
 create mode 100755 abs/core/runit-scripts/runitscripts/services/zoneminder/run

diff --git a/abs/core/runit-scripts/PKGBUILD b/abs/core/runit-scripts/PKGBUILD
index 83530fe..17280f9 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=78
+pkgrel=82
 pkgdesc="collection of startup scripts for runit"
 url="http://smarden.org/runit/"
 license="BSD"
diff --git a/abs/core/runit-scripts/runitscripts/services/Xvfb/run b/abs/core/runit-scripts/runitscripts/services/Xvfb/run
index 71ffedd..b45b4ae 100755
--- a/abs/core/runit-scripts/runitscripts/services/Xvfb/run
+++ b/abs/core/runit-scripts/runitscripts/services/Xvfb/run
@@ -1,4 +1,5 @@
 #!/bin/bash
+MYTH_RUN_STATUS="1"
 . /etc/profile
 export TERM=linux
 . /etc/rc.conf
diff --git a/abs/core/runit-scripts/runitscripts/services/acpid/run b/abs/core/runit-scripts/runitscripts/services/acpid/run
index bffb564..808808f 100755
--- a/abs/core/runit-scripts/runitscripts/services/acpid/run
+++ b/abs/core/runit-scripts/runitscripts/services/acpid/run
@@ -3,5 +3,6 @@ exec 2>&1
 export TERM=linux
 . /etc/rc.conf
 . /etc/rc.d/functions
+svwaitup -s 10 /service/rsyslog
 stat_runit "Starting acpid"
-exec /usr/sbin/acpid  -f -c /etc/acpi/events 
+exec /usr/sbin/acpid  -f -l  -c /etc/acpi/events  
diff --git a/abs/core/runit-scripts/runitscripts/services/evrouter/run b/abs/core/runit-scripts/runitscripts/services/evrouter/run
index 56f7ae6..7d9e1d2 100755
--- a/abs/core/runit-scripts/runitscripts/services/evrouter/run
+++ b/abs/core/runit-scripts/runitscripts/services/evrouter/run
@@ -1,4 +1,5 @@
 #!/bin/bash
+MYTH_RUN_STATUS="1"
 . /etc/profile
 export TERM=linux
 . /etc/rc.conf
diff --git a/abs/core/runit-scripts/runitscripts/services/msg_daemon/run b/abs/core/runit-scripts/runitscripts/services/msg_daemon/run
index f789d0b..76bb702 100755
--- a/abs/core/runit-scripts/runitscripts/services/msg_daemon/run
+++ b/abs/core/runit-scripts/runitscripts/services/msg_daemon/run
@@ -1,4 +1,5 @@
 #!/bin/sh
+MYTH_RUN_STATUS="1"
 export TERM=linux
 . /etc/rc.conf
 . /etc/rc.d/functions
diff --git a/abs/core/runit-scripts/runitscripts/services/mysql/run b/abs/core/runit-scripts/runitscripts/services/mysql/run
index f078c87..de76962 100755
--- a/abs/core/runit-scripts/runitscripts/services/mysql/run
+++ b/abs/core/runit-scripts/runitscripts/services/mysql/run
@@ -41,4 +41,5 @@ MYSQLADMIN='/usr/bin/mysqladmin'
 trap "$MYSQLADMIN shutdown" 0
 trap 'exit 2' 1 2 3 15
 
-/usr/bin/mysqld_safe --user=mysql & wait
+/usr/bin/mysqld_safe --user=mysql >/dev/null 2>/dev/null & wait
+
diff --git a/abs/core/runit-scripts/runitscripts/services/mythbackend/run b/abs/core/runit-scripts/runitscripts/services/mythbackend/run
index 937b267..152beb4 100755
--- a/abs/core/runit-scripts/runitscripts/services/mythbackend/run
+++ b/abs/core/runit-scripts/runitscripts/services/mythbackend/run
@@ -5,7 +5,7 @@ export TERM=linux
 . /etc/rc.conf
 . /etc/rc.d/functions
 #wait for mysql
-/sbin/svwaitup -s 5 /service/mysql
+/sbin/svwaitup -s 10 /service/mysql
 
 #profile is here to setup LC_ALL/locale
 MYTH_RUN_STATUS="1"
@@ -34,11 +34,6 @@ fi
 
 stat_runit "Starting MythBackend"
 export HOME=/root
-if [ ! x$SystemType = xSlave_backend ]
-then
-	sv start mysql > /dev/null 2>/dev/null
-fi
-#echo "Starting mythbackend"
 # 	if [ -f /tmp/debug ]
 # 		then
 # 			echo "using gbd/debug"
diff --git a/abs/core/runit-scripts/runitscripts/services/ntpd/run b/abs/core/runit-scripts/runitscripts/services/ntpd/run
index 146c4e0..ce1ff12 100755
--- a/abs/core/runit-scripts/runitscripts/services/ntpd/run
+++ b/abs/core/runit-scripts/runitscripts/services/ntpd/run
@@ -5,6 +5,6 @@ export TERM=linux
 stat_runit "Starting NTPD"
 printhl "    Fetching time"
 msg=`/usr/bin/ntpdate pool.ntp.org `
-printhl "   $msg"
+#printhl "   $msg"
 
 exec /usr/bin/ntpd -n -p /var/run/ntpd.pid 2>/dev/null
diff --git a/abs/core/runit-scripts/runitscripts/services/zoneminder/finish b/abs/core/runit-scripts/runitscripts/services/zoneminder/finish
new file mode 100755
index 0000000..dbc311f
--- /dev/null
+++ b/abs/core/runit-scripts/runitscripts/services/zoneminder/finish
@@ -0,0 +1,5 @@
+#!/bin/bash
+export TERM=linux
+. /etc/rc.conf
+. /etc/rc.d/functions
+/usr/bin/zmpkg.pl stop
diff --git a/abs/core/runit-scripts/runitscripts/services/zoneminder/run b/abs/core/runit-scripts/runitscripts/services/zoneminder/run
new file mode 100755
index 0000000..dfd15f3
--- /dev/null
+++ b/abs/core/runit-scripts/runitscripts/services/zoneminder/run
@@ -0,0 +1,28 @@
+#!/bin/bash
+exec 2>&1
+
+export TERM=linux
+MYTH_RUN_STATUS="1"
+. /etc/rc.conf
+. /etc/rc.d/functions
+#wait for mysql
+/sbin/svwaitup -s 20 /service/mysql
+
+stat_runit "Starting ZoneMinder"
+/usr/bin/zmpkg.pl start  2>/tmp/zoneminder.out
+rc=$?
+if [ $rc = 0 ]
+then
+   PID=`pidof -x zmdc.pl`
+   while [[ -d /proc/$PID ]]
+   do
+      sleep 45
+   done
+else
+  stat_runit "Zoneminder did not start correctly"
+fi 
+
+
+
+
+
-- 
cgit v0.12

