[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: OpenLDAP 2.1.23/Solaris 9 startup script



On Thu, 4 Dec 2003, Chew, Darren wrote:

>Hi All,
>
>Does anyone know where I can find a startup script for OpenLDAP 2.1.23
>suitable for use with Solaris 9? Is there one included in the source
>tarball? Or does the make install put it somewhere? I have been unable to
>find one but have seen some for Linux. Looking for one which will also
>start slurpd as well as slapd.

This one works for us. Name it e.g. 'openldap' and put it into
/etc/init.d. Permissions should be 744, root:other. Don't forget to link
it into the rc directories else it won't run during boot time:
	ln /etc/init.d/openldap /etc/rc2.d/S99openldap


Thomas

---

#!/bin/sh

URI='ldap://somehost.somedomain/ ldap://localhost/'
EXEC=/ldap/openldap/libexec/slapd

pid=`pgrep -x -u 0 -u ldap slapd`
case "$1" in
        start)  if [ -x $EXEC -a "$pid" = "" ]; then
                        $EXEC -u ldap -g ldap -h "$URI"
                        echo 'slapd'
                fi
                ;;
        stop)   if [ "$pid" ]; then
                        echo 'stopping slapd'
                        kill $pid
                fi
                ;;

        *)      echo "usage: $0 {start|stop}";;
esac