diff options
author | jlam <jlam> | 2002-01-27 00:04:41 +0000 |
---|---|---|
committer | jlam <jlam> | 2002-01-27 00:04:41 +0000 |
commit | 45005d52464c72d8b549de407cb5ca2955a30522 (patch) | |
tree | 8bbd71386db81b327c0625307efafdd2218bf180 /mail | |
parent | 75f9e676da9e3c9ef30c18c7e2e0d74d6a0f327a (diff) | |
download | pkgsrc-45005d52464c72d8b549de407cb5ca2955a30522.tar.gz |
Fix the authdaemond rc.d script to accurately report status. The actual
process executed is one of authdaemond.{plain,ldpa,mysql,pgsql}, so read
the authdaemonrc config file to find which one was executed. Problem noted
by Amitai Schlair in private e-mail.
Diffstat (limited to 'mail')
-rw-r--r-- | mail/courier-auth/files/authdaemond.sh | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/mail/courier-auth/files/authdaemond.sh b/mail/courier-auth/files/authdaemond.sh index 870bff5a15b..4f373ff67df 100644 --- a/mail/courier-auth/files/authdaemond.sh +++ b/mail/courier-auth/files/authdaemond.sh @@ -1,6 +1,6 @@ #! /bin/sh # -# $NetBSD: authdaemond.sh,v 1.1.1.1 2002/01/22 22:00:22 jlam Exp $ +# $NetBSD: authdaemond.sh,v 1.2 2002/01/27 00:04:41 jlam Exp $ # # Courier user authentication daemon # @@ -14,13 +14,32 @@ fi name="authdaemond" rcvar=${name} -command="@PREFIX@/libexec/courier/authlib/authdaemond" +daemon="@PREFIX@/libexec/courier/authlib/authdaemond" pidfile="/var/authdaemon/pid" required_files="@PKG_SYSCONFDIR@/authdaemonrc" start_cmd="courier_doit start" stop_cmd="courier_doit stop" +# Read the authdaemond config file to determine the actual command +# executed. If "$version" is non-empty, then it contains the +# command name, otherwise, use the default of "authdaemond.plain". +# We read the config file in a subprocess to protect against shell +# environment pollution. +# +if [ -f @PKG_SYSCONFDIR@/authdaemonrc ] +then + command=` + . @PKG_SYSCONFDIR@/authdaemonrc + if [ -n "${version}" ] + then + @ECHO@ @PREFIX@/libexec/courier/authlib/${version} + else + @ECHO@ @PREFIX@/libexec/courier/authlib/authdaemond.plain + fi + ` +fi + courier_doit() { action=$1 @@ -29,7 +48,7 @@ courier_doit() stop) echo "Stopping ${name}." ;; esac - @SETENV@ - ${command} ${action} + @SETENV@ - ${daemon} ${action} } if [ -e /etc/rc.subr ] |