Detect OpenLDAP data directory from the configuration and use it for

further operation.

Submitted by:	Mikhail Goriachev <mikhailg webanoide org>
This commit is contained in:
Xin LI 2008-07-07 20:54:21 +00:00
parent f92755b7ed
commit 426507053f
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=216496
2 changed files with 5 additions and 3 deletions

View file

@ -39,7 +39,7 @@ BROKEN= incompatible OpenLDAP version: ${WANT_OPENLDAP_VER}
.endif
PORTREVISION_CLIENT= 0
PORTREVISION_SERVER= 0
PORTREVISION_SERVER= 1
.if !defined(CLIENT_ONLY)
OPTIONS= SASL "With (Cyrus) SASL2 support" off \

View file

@ -39,6 +39,8 @@ start_postcmd=start_postcmd
# extract user and group, adjust ownership of directories and database
DBDIR=`awk '$1 == "directory" {print $2}' "%%PREFIX%%/etc/openldap/slapd.conf"`
start_precmd()
{
local slapd_ownername slapd_groupname
@ -48,8 +50,8 @@ start_precmd()
;;
*)
chown "$slapd_owner" "%%LDAP_RUN_DIR%%"
chown -RL "$slapd_owner" "%%DATABASEDIR%%"
chmod 700 "%%DATABASEDIR%%"
chown -RL "$slapd_owner" "${DBDIR}"
chmod 700 "${DBDIR}"
chown "$slapd_owner" "%%PREFIX%%/etc/openldap/slapd.conf"
slapd_ownername="${slapd_owner%:*}"