pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mail/gld/files Add another changeable option via rc.co...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/1d060a7875c7
branches:  trunk
changeset: 487744:1d060a7875c7
user:      xtraeme <xtraeme%pkgsrc.org@localhost>
date:      Wed Jan 19 15:39:44 2005 +0000

description:
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:

 mail/gld/files/gld.sh |  13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diffs (33 lines):

diff -r 9b5668675beb -r 1d060a7875c7 mail/gld/files/gld.sh
--- a/mail/gld/files/gld.sh     Wed Jan 19 15:31:59 2005 +0000
+++ b/mail/gld/files/gld.sh     Wed Jan 19 15:39:44 2005 +0000
@@ -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 @@
 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"



Home | Main Index | Thread Index | Old Index