diff options
author | edwin <edwin@FreeBSD.org> | 2003-08-30 09:11:51 +0000 |
---|---|---|
committer | edwin <edwin@FreeBSD.org> | 2003-08-30 09:11:51 +0000 |
commit | 9af2de95ec48c52349afd58b8dd35826395ca366 (patch) | |
tree | 53d9b5b5e82998b0d93ef5caba5084603924ea88 /net/openldap22-server/files | |
parent | 0a787787d9e73674401ee9381025c5b492ae81bf (diff) | |
download | FreeBSD-ports-9af2de95ec48c52349afd58b8dd35826395ca366.zip FreeBSD-ports-9af2de95ec48c52349afd58b8dd35826395ca366.tar.gz |
[MAINTAINER] ports net/openldap2[012]-server: didn't start upon boot on 5.x, misc. improvements
- the start/stop scripts failed when booting on 5.x machines,
detected by Barry Pederson <bp@barryp.org>
- Fix OpenLDAP ITS 2672: eternal loop in back-bdb (2.1 only)
- unify the start/stop scripts again, so that they are identical
across versions
- added a check for the deprecated variable slapd_args
PR: ports/56174
Submitted by: Oliver Eikemeier <eikemeier@fillmore-labs.com>
Diffstat (limited to 'net/openldap22-server/files')
-rw-r--r-- | net/openldap22-server/files/slapd.sh | 60 | ||||
-rw-r--r-- | net/openldap22-server/files/slurpd.sh | 11 |
2 files changed, 48 insertions, 23 deletions
diff --git a/net/openldap22-server/files/slapd.sh b/net/openldap22-server/files/slapd.sh index f9d970c..d9c1c63 100644 --- a/net/openldap22-server/files/slapd.sh +++ b/net/openldap22-server/files/slapd.sh @@ -21,7 +21,7 @@ # by default slapd runs under the non-privileged user id `ldap'. If you # want to run slapd as root, override this in /etc/rc.conf with # -#slapd_owner= +#slapd_owner="DEFAULT" # . %%RC_SUBR%% @@ -37,47 +37,67 @@ required_files=%%PREFIX%%/etc/openldap/slapd.conf start_precmd=start_precmd start_postcmd=start_postcmd +# extract user and group, adjust ownership of directories and database + start_precmd() { - if [ x"$slapd_owner" != x ]; then - chown "${slapd_owner}" "%%LDAP_RUN_DIR%%" - chown -RL "${slapd_owner}" "%%LOCALSTATEDIR%%/openldap-data" - chown "${slapd_owner}" "%%PREFIX%%/etc/openldap/slapd.conf" + case x"$slapd_owner" in + x|x[Nn][Oo][Nn][Ee]|x[Dd][Ee][Ff][Aa][Uu][Ll][Tt]) + ;; + x*) + chown "$slapd_owner" "%%LDAP_RUN_DIR%%" + chown -RL "$slapd_owner" "%%DATABASEDIR%%" + chown "$slapd_owner" "%%PREFIX%%/etc/openldap/slapd.conf" slapd_ownername=`expr //"$slapd_owner" : //'\([^:]*\)'` slapd_groupname=`expr //"$slapd_owner" : //'.*:\([^:]*\)'` - if [ x"$slapd_ownername" != x ]; then + if [ -n "$slapd_ownername" ]; then rc_flags="$rc_flags -u $slapd_ownername" fi - if [ x"$slapd_groupname" != x ]; then + if [ -n "$slapd_groupname" ]; then rc_flags="$rc_flags -g $slapd_groupname" fi - fi + ;; + esac } +# adjust ownership of created unix sockets + start_postcmd() { - for socket in ${slapd_sockets}; do + for socket in $slapd_sockets; do for seconds in 1 2 3 4 5; do - test -e ${socket} && break + [ -e "$socket" ] && break sleep 1 done - if [ -S ${socket} ]; then - if [ x"$slapd_owner" != x ]; then - chown "${slapd_owner}" ${socket} - fi - chmod "${slapd_sockets_mode}" ${socket} + if [ -S "$socket" ]; then + case x"$slapd_owner" in + x|x[Nn][Oo][Nn][Ee]|x[Dd][Ee][Ff][Aa][Uu][Ll][Tt]) + ;; + x*) + chown "$slapd_owner" "$socket" + ;; + esac + chmod "$slapd_sockets_mode" "$socket" fi done } -slapd_enable="NO" -slapd_flags= +# set defaults + +[ -z "$slapd_enable" ] && slapd_enable=NO +[ -z "$slapd_flags" ] && slapd_flags= -slapd_owner=ldap:ldap -slapd_sockets= -slapd_sockets_mode=666 +[ -z "$slapd_owner" ] && slapd_owner=ldap:ldap +[ -z "$slapd_sockets" ] && slapd_sockets= +[ -z "$slapd_sockets_mode" ] && slapd_sockets_mode=666 load_rc_config $name + +if [ -n "$slapd_args" ]; then + warn "slapd_args is deprecated, use slapd_flags" + slapd_flags="$slapd_args" +end + run_rc_command "$1" diff --git a/net/openldap22-server/files/slurpd.sh b/net/openldap22-server/files/slurpd.sh index ba2f294..434dca3 100644 --- a/net/openldap22-server/files/slurpd.sh +++ b/net/openldap22-server/files/slurpd.sh @@ -23,9 +23,14 @@ rcvar=`set_rcvar` command=%%PREFIX%%/libexec/slurpd required_files=%%PREFIX%%/etc/openldap/slapd.conf - -slurpd_enable="NO" -slurpd_args= +[ -z "$slurpd_enable" ] && slurpd_enable="NO" +[ -z "$slurpd_flags" ] && slurpd_flags= load_rc_config $name + +if [ -n "$slurpd_args" ]; then + warn "slurpd_args is deprecated, use slurpd_flags" + slurpd_flags="$slurpd_args" +end + run_rc_command "$1" |