Merge from vendor branch TNF:
[pkgsrc.git] / security / cyrus-saslauthd / files / saslauthd.sh
1 #!@RCD_SCRIPTS_SHELL@
2 #
3 # $NetBSD: saslauthd.sh,v 1.2 2004/01/12 04:52:34 jlam Exp $
4 #
5 # The saslauthd daemon allows cleartext UNIX password authentication via
6 # several authentication mechanisms with Cyrus SASL.
7 #
8 # PROVIDE: saslauthd
9 # REQUIRE: DAEMON
10
11 if [ -f /etc/rc.subr ]; then
12         . /etc/rc.subr
13 fi
14
15 name="saslauthd"
16 rcvar="${name}"
17 command="@PREFIX@/sbin/saslauthd"
18 pidfile="@SASLSOCKETDIR@/${name}.pid"
19 start_precmd="saslauthd_precmd"
20
21 # Default to authenticating against local password database.
22 : ${saslauthd_flags="-a getpwent"}
23
24 saslauthd_precmd()
25 {
26         if [ ! -d @SASLSOCKETDIR@ ]; then
27                 @MKDIR@ @SASLSOCKETDIR@
28                 @CHMOD@ 0755 @SASLSOCKETDIR@
29                 @CHOWN@ @ROOT_USER@ @SASLSOCKETDIR@
30         fi
31 }
32
33 if [ -f /etc/rc.subr ]; then
34         load_rc_config $name
35         run_rc_command "$1"
36 else
37         @ECHO@ -n " ${name}"
38         ${command} ${saslauthd_flags} ${command_args}
39 fi