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/courier-imap | |
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/courier-imap')
-rwxr-xr-x | mail/courier-imap/files/courierimap.sh | 18 | ||||
-rwxr-xr-x | mail/courier-imap/files/courierimaps.sh | 18 | ||||
-rwxr-xr-x | mail/courier-imap/files/courierpop.sh | 18 | ||||
-rwxr-xr-x | mail/courier-imap/files/courierpops.sh | 18 |
4 files changed, 60 insertions, 12 deletions
diff --git a/mail/courier-imap/files/courierimap.sh b/mail/courier-imap/files/courierimap.sh index d5b60723f91..d45d510d369 100755 --- a/mail/courier-imap/files/courierimap.sh +++ b/mail/courier-imap/files/courierimap.sh @@ -1,6 +1,6 @@ #!@RCD_SCRIPTS_SHELL@ # -# $NetBSD: courierimap.sh,v 1.7 2004/02/22 03:13:07 jlam Exp $ +# $NetBSD: courierimap.sh,v 1.8 2004/02/24 01:18:52 jlam Exp $ # # Courier IMAP services daemon # @@ -25,8 +25,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 ${ctl_command} ${action} diff --git a/mail/courier-imap/files/courierimaps.sh b/mail/courier-imap/files/courierimaps.sh index ea710b2703f..4a15b0c4d57 100755 --- a/mail/courier-imap/files/courierimaps.sh +++ b/mail/courier-imap/files/courierimaps.sh @@ -1,6 +1,6 @@ #!@RCD_SCRIPTS_SHELL@ # -# $NetBSD: courierimaps.sh,v 1.7 2004/02/22 03:13:07 jlam Exp $ +# $NetBSD: courierimaps.sh,v 1.8 2004/02/24 01:18:52 jlam Exp $ # # Courier IMAP/SSL services daemon # @@ -26,8 +26,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 ${ctl_command} ${action} diff --git a/mail/courier-imap/files/courierpop.sh b/mail/courier-imap/files/courierpop.sh index 90ab3ac277b..0965e3b5e50 100755 --- a/mail/courier-imap/files/courierpop.sh +++ b/mail/courier-imap/files/courierpop.sh @@ -1,6 +1,6 @@ #!@RCD_SCRIPTS_SHELL@ # -# $NetBSD: courierpop.sh,v 1.7 2004/02/22 03:13:07 jlam Exp $ +# $NetBSD: courierpop.sh,v 1.8 2004/02/24 01:18:52 jlam Exp $ # # Courier POP services daemon # @@ -25,8 +25,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 ${ctl_command} ${action} diff --git a/mail/courier-imap/files/courierpops.sh b/mail/courier-imap/files/courierpops.sh index 3ff55a64273..50419c85fda 100755 --- a/mail/courier-imap/files/courierpops.sh +++ b/mail/courier-imap/files/courierpops.sh @@ -1,6 +1,6 @@ #!@RCD_SCRIPTS_SHELL@ # -# $NetBSD: courierpops.sh,v 1.7 2004/02/22 03:13:07 jlam Exp $ +# $NetBSD: courierpops.sh,v 1.8 2004/02/24 01:18:52 jlam Exp $ # # Courier POP3/SSL services daemon # @@ -26,8 +26,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 ${ctl_command} ${action} |