#!/sbin/openrc-run

extra_commands="checkconfig"
cfg="/etc/nslcd.conf"
command=/usr/sbin/nslcd
pidfile=/var/run/nslcd/nslcd.pid


depend() {
	need net	
	after firewall
	use dns logger
}

checkconfig() {
	if [ -f "$cfg" ] ; then
		return 0
	fi
	eerror "Please create $cfg"
	eerror "Example config: /usr/share/nss-ldapd/nslcd.conf"
	return 1
}

start_pre() {
	checkpath -q -d ${pidfile%/*} -o nslcd:nslcd
	checkconfig || return $?
}
