summaryrefslogtreecommitdiff
path: root/net/nss-pam-ldapd/files/nslcd.in
blob: dffad8c63cf22040799e61595142b8d9f9c31241 (plain) (blame)
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
42
43
44
45
46
47
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: nslcd
# REQUIRE: ldconfig resolv
# BEFORE: syslogd
#
# Add the following line to /etc/rc.conf to enable the nslcd daemon:
#
# nslcd_enable="YES"
#
# Optional:
# nslcd_debug="NO" - start nslcd in debugging mode (does not daemonize).
#

. /etc/rc.subr

name=nslcd
rcvar=nslcd_enable

load_rc_config ${name}

: ${nslcd_enable="NO"}
: ${nslcd_debug="NO"}

command="%%PREFIX%%/sbin/${name}"
pidfile="/var/run/${name}.pid"
start_precmd="nslcd_prestart"
start_postcmd="nslcd_poststart"

nslcd_prestart () {
	if checkyesno nslcd_debug
	then
		command_args="-d"
	fi
}

nslcd_poststart () {
       until $(%%PREFIX%%/sbin/${name} -c); do
               echo " Waiting for nslcd to start"
               sleep 1
       done
}


run_rc_command "$1"