summaryrefslogtreecommitdiff
path: root/mail
diff options
context:
space:
mode:
authorxtraeme <xtraeme@pkgsrc.org>2005-01-19 15:39:44 +0000
committerxtraeme <xtraeme@pkgsrc.org>2005-01-19 15:39:44 +0000
commit7c2b2e8149705be412b4f14849d393ac0956651d (patch)
treee5a5c53a5d047489987f2a3c65127fda11561ee6 /mail
parentf26183d798f1de3bbd1b3cefc83edd23150979d3 (diff)
downloadpkgsrc-7c2b2e8149705be412b4f14849d393ac0956651d.tar.gz
Add another changeable option via rc.conf "gld_waitmysql_seconds",
with a default value of "5" seconds to wait for mysql. This is necessary because the gld process needs mysqld available when it's loaded, and sometimes when booting mysqld, it needs more than 2 seconds to be available.
Diffstat (limited to 'mail')
-rw-r--r--mail/gld/files/gld.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/mail/gld/files/gld.sh b/mail/gld/files/gld.sh
index 73e66ae020c..a341a5ef3a8 100644
--- a/mail/gld/files/gld.sh
+++ b/mail/gld/files/gld.sh
@@ -1,6 +1,6 @@
#!@RCD_SCRIPTS_SHELL@
#
-# $NetBSD: gld.sh,v 1.3 2004/11/29 16:17:22 xtraeme Exp $
+# $NetBSD: gld.sh,v 1.4 2005/01/19 15:39:44 xtraeme Exp $
#
# PROVIDE: gld
@@ -14,10 +14,21 @@ rcvar=$name
command="@PREFIX@/bin/${name}"
required_files="@PKG_SYSCONFDIR@/$name.conf"
pidfile="@VARBASE@/run/${name}.pid"
+extra_commands="gld_waitmysql_seconds"
+
+: ${gld_waitmysql_seconds:=5}
+start_precmd="waitmysql $gld_waitmysql_seconds"
if [ "$1" != "stop" -o "$1" != "status" ]; then
echo $(check_process $command) > $pidfile
fi
+waitmysql()
+{
+ _sec=$1
+ echo "$name: waiting for MySQL ${_sec} seconds..."
+ sleep ${_sec}
+}
+
load_rc_config $name
run_rc_command "$1"