openldap/rc.openldap

Tue, 29 Mar 2011 20:04:34 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 29 Mar 2011 20:04:34 +0200
changeset 334
4a34d7a82eab
permissions
-rw-r--r--

Rework package yet again, correcting and introducing new buildconf logic:
Conditionally disable bootstrap stage comparison correctly, correct
english grammar, better find system as(1) and ld(1), indotruce detailed
optimization option messages, more completely guess cpu types, allow
profiled bootstrapping without a preinstalled GCC because many other
compilers have long since implemented 64-bit arithmetic, instruct make
to build sequentially (not in sparallel) when building a profiled
bootstrap as GCC online documents recommend, and generally improve
comment blocks.

The single most important correction in this changeset relates to the
GCC changed optimization policy since at least GCC 4.5, in which -march
is always passed and not always correctly guessed. In the case of this
package, allowing GCC to guess the architecture leads to wild build
errors at various subcomponents (zlib, libgcc, libiberty...) and
bootstrap stages. It seems quite platform specific, and the safest
approach to correcting this seems to be explicitly always specifying the
-march argument when bootstrapping GCC. Because the best choice 'native'
is not available when bootstrapping using a foreign (non GCC) compiler,
a guess is made according to rpmmacros l_platform in that case.

It is questionable as to whether these recent optimization changes
on the part of GCC or this package are compatible with each other,
or if either are complete or correct at all. At least applying these
corrections allows this package to build again in most cases test.

michael@174 1 #!@l_prefix@/bin/openpkg rc
michael@174 2 ##
michael@174 3 ## rc.openldap -- Run-Commands
michael@174 4 ##
michael@174 5
michael@174 6 %config
michael@174 7 openldap_enable="$openpkg_rc_def"
michael@174 8 openldap_flags=""
michael@174 9 openldap_url="ldap://127.0.0.1:389/"
michael@174 10 openldap_log_prolog="true"
michael@174 11 openldap_log_epilog="true"
michael@174 12 openldap_log_numfiles="10"
michael@174 13 openldap_log_minsize="1M"
michael@174 14 openldap_log_complevel="9"
michael@174 15
michael@174 16 %common
michael@174 17 openldap_slapd_cfgfile="@l_prefix@/etc/openldap/slapd.conf"
michael@174 18 openldap_slapd_pidfile="@l_prefix@/var/openldap/run/slapd.pid"
michael@174 19 openldap_slapd_signal () {
michael@174 20 [ -f $openldap_slapd_pidfile ] && kill -$1 `cat $openldap_slapd_pidfile`
michael@174 21 }
michael@174 22
michael@174 23 %status -u @l_susr@ -o
michael@174 24 openldap_usable="unknown"
michael@174 25 openldap_active="no"
michael@174 26 rcService openldap enable yes && \
michael@174 27 openldap_slapd_signal 0 && openldap_active="yes"
michael@174 28 echo "openldap_enable=\"$openldap_enable\""
michael@174 29 echo "openldap_usable=\"$openldap_usable\""
michael@174 30 echo "openldap_active=\"$openldap_active\""
michael@174 31
michael@174 32 %start -p 300 -u @l_susr@
michael@174 33 rcService openldap enable yes || exit 0
michael@174 34 openldap_slapd_signal 0
michael@174 35 if [ $? -ne 0 ]; then
michael@174 36 flags="$openldap_flags"
michael@174 37 echo $flags | grep -- -h >/dev/null
michael@174 38 if [ $? -ne 0 -a ".$openldap_url" != . ]; then
michael@174 39 flags="$flags -h \"$openldap_url\""
michael@174 40 fi
michael@174 41 eval @l_prefix@/libexec/openldap/slapd $flags || exit $?
michael@174 42 fi
michael@174 43
michael@174 44 %stop -p 700 -u @l_susr@
michael@174 45 rcService openldap enable yes || exit 0
michael@174 46 rcService openldap active no && exit 0
michael@174 47 openldap_slapd_signal INT
michael@174 48 sleep 2
michael@174 49
michael@174 50 %restart -u @l_susr@
michael@174 51 rcService openldap enable yes || exit 0
michael@174 52 rcService openldap active no && exit 0
michael@174 53 rc openldap stop start
michael@174 54
michael@174 55 %daily -u @l_susr@
michael@174 56 rcService openldap enable yes || exit 0
michael@174 57 shtool rotate -f \
michael@174 58 -n ${openldap_log_numfiles} -s ${openldap_log_minsize} -d \
michael@174 59 -z ${openldap_log_complevel} -m 644 -o @l_susr@ -g @l_mgrp@ \
michael@174 60 -P "${openldap_log_prolog}" \
michael@174 61 -E "${openldap_log_epilog}; rc openldap restart" \
michael@174 62 @l_prefix@/var/openldap/openldap.log
michael@174 63

mercurial