aboutsummaryrefslogtreecommitdiff
path: root/net/nss-pam-ldapd/files/nslcd.in
diff options
context:
space:
mode:
Diffstat (limited to 'net/nss-pam-ldapd/files/nslcd.in')
-rw-r--r--net/nss-pam-ldapd/files/nslcd.in23
1 files changed, 18 insertions, 5 deletions
diff --git a/net/nss-pam-ldapd/files/nslcd.in b/net/nss-pam-ldapd/files/nslcd.in
index ab316ef0dcbf..dffad8c63cf2 100644
--- a/net/nss-pam-ldapd/files/nslcd.in
+++ b/net/nss-pam-ldapd/files/nslcd.in
@@ -10,16 +10,32 @@
#
# nslcd_enable="YES"
#
-
-nslcd_enable=${nslcd_enable-"NO"}
+# 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"
@@ -27,8 +43,5 @@ nslcd_poststart () {
done
}
-command="%%PREFIX%%/sbin/${name}"
-pidfile="/var/run/${name}.pid"
-load_rc_config ${name}
run_rc_command "$1"