summaryrefslogtreecommitdiff
path: root/security/cyrus-saslauthd/files/saslauthd.sh
blob: 747103a7aff21ac1bece84f1a0d6d795ef998ffe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: saslauthd.sh,v 1.2 2004/01/12 04:52:34 jlam Exp $
#
# The saslauthd daemon allows cleartext UNIX password authentication via
# several authentication mechanisms with Cyrus SASL.
#
# PROVIDE: saslauthd
# REQUIRE: DAEMON

if [ -f /etc/rc.subr ]; then
	. /etc/rc.subr
fi

name="saslauthd"
rcvar="${name}"
command="@PREFIX@/sbin/saslauthd"
pidfile="@SASLSOCKETDIR@/${name}.pid"
start_precmd="saslauthd_precmd"

# Default to authenticating against local password database.
if [ -z "${saslauthd_flags}" ]; then
	saslauthd_flags="-a getpwent"
fi

saslauthd_precmd()
{
        if [ ! -d @SASLSOCKETDIR@ ]; then
                @MKDIR@ @SASLSOCKETDIR@
                @CHMOD@ 0755 @SASLSOCKETDIR@
                @CHOWN@ @ROOT_USER@ @SASLSOCKETDIR@
        fi
}

if [ -f /etc/rc.subr ]; then
	load_rc_config $name
	run_rc_command "$1"
else
	@ECHO@ -n " ${name}"
	${command} ${saslauthd_flags} ${command_args}
fi