diff options
author | jlam <jlam@pkgsrc.org> | 2004-02-24 01:18:52 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2004-02-24 01:18:52 +0000 |
commit | ba8bd65c9c59eea89399f94aeeedd7e05b31cd31 (patch) | |
tree | 7acca2de1326e92d263dc463f2e24a243387b19b /mail/sqwebmail | |
parent | 041dc17379dfab834c3ad9842ecd53d2b6f5e351 (diff) | |
download | pkgsrc-ba8bd65c9c59eea89399f94aeeedd7e05b31cd31.tar.gz |
Check that the required_files do exist before starting the process. If
start_cmd is defined, then rc.subr skips the required_files check, so do it
ourselves within the start_cmd.
Diffstat (limited to 'mail/sqwebmail')
-rw-r--r-- | mail/sqwebmail/files/pcpd.sh | 18 | ||||
-rw-r--r-- | mail/sqwebmail/files/sqwebmaild.sh | 19 |
2 files changed, 31 insertions, 6 deletions
diff --git a/mail/sqwebmail/files/pcpd.sh b/mail/sqwebmail/files/pcpd.sh index 3e9977a0b34..77911acd7c2 100644 --- a/mail/sqwebmail/files/pcpd.sh +++ b/mail/sqwebmail/files/pcpd.sh @@ -1,6 +1,6 @@ #!@RCD_SCRIPTS_SHELL@ # -# $NetBSD: pcpd.sh,v 1.1 2004/02/23 23:41:43 jlam Exp $ +# $NetBSD: pcpd.sh,v 1.2 2004/02/24 01:18:52 jlam Exp $ # # Courier SqWebMail calendaring services daemon # @@ -23,8 +23,20 @@ courier_doit() { action=$1 case ${action} in - start) @ECHO@ "Starting ${name}." ;; - stop) @ECHO@ "Stopping ${name}." ;; + start) + for f in $required_files; do + if [ ! -r "$f" ]; then + @ECHO@ "$0: WARNING: $f is not readable" + if [ -z $rc_force ]; then + return 1 + fi + fi + done + @ECHO@ "Starting ${name}." + ;; + stop) + @ECHO@ "Stopping ${name}." + ;; esac ${command} ${action} diff --git a/mail/sqwebmail/files/sqwebmaild.sh b/mail/sqwebmail/files/sqwebmaild.sh index 98c33e6522e..7fccac2249b 100644 --- a/mail/sqwebmail/files/sqwebmaild.sh +++ b/mail/sqwebmail/files/sqwebmaild.sh @@ -1,6 +1,6 @@ #!@RCD_SCRIPTS_SHELL@ # -# $NetBSD: sqwebmaild.sh,v 1.1 2004/02/23 23:41:43 jlam Exp $ +# $NetBSD: sqwebmaild.sh,v 1.2 2004/02/24 01:18:52 jlam Exp $ # # Courier SqWebMail services daemon # @@ -14,6 +14,7 @@ fi name="sqwebmaild" rcvar=${name} command="@PREFIX@/libexec/courier/sqwebmail/sqwebmaild" +pidfile="@SQWEBMAIL_STATEDIR@/sqwebmail.sock.pid" required_files="@PKG_SYSCONFDIR@/authmodulelist" start_cmd="courier_doit start" @@ -23,8 +24,20 @@ courier_doit() { action=$1 case ${action} in - start) @ECHO@ "Starting ${name}." ;; - stop) @ECHO@ "Stopping ${name}." ;; + start) + for f in $required_files; do + if [ ! -r "$f" ]; then + @ECHO@ "$0: WARNING: $f is not readable" + if [ -z $rc_force ]; then + return 1 + fi + fi + done + @ECHO@ "Starting ${name}." + ;; + stop) + @ECHO@ "Stopping ${name}." + ;; esac ${command} ${action} |