#!/bin/sh # # "$Id: initd.script,v 1.1 2005/02/10 08:44:46 elkner Exp $" # # description: # Lightweight Directory Access Protocol (LDAP) daemon start/shutdown script. # # default: S/K45 0/K45 2/S70 . /lib/svc/share/smf_include.sh BASEDIR=@CLIENT_BASEDIR@ LDAP_USER=`/usr/bin/svcprop -p start/user $SMF_FMRI 2>/dev/null` if [ -z "$LDAP_USER" -o '""' = "$LDAP_USER" ]; then LDAP_USER="nobody" fi CONF=`/usr/bin/svcprop -p config/file svc:/network/openldap/slapd:default 2>/dev/null` if [ -z "$CONF" -o '""' = "$CONF" ]; then CONF="/etc/openldap/slapd.conf" fi SLURPD_OPTIONS=`/usr/bin/svcprop -p config/slurpd_options $SMF_FMRI 2>/dev/null` if [ '""' = "$SLURPD_OPTIONS" ]; then SLURPD_OPTIONS="" fi SPATH=@CLIENT_BASEDIR@/sbin SLURPD=slurpd SLURPD_NAME="LDAP replication daemon" case $1 in start) egrep -q "^replogfile" "$CONF" if [ $? -ne 0 ]; then # no need to start the replication daemon exit $SMF_EXIT_MON_OFFLINE fi if [ ! -x "$SPATH/$SLURPD" ]; then echo "$SPATH/$SLURPD is not executable" exit $SMF_EXIT_ERR_FATAL else /usr/bin/echo "Starting $SLURPD_NAME ...\c" $SPATH/$SLURPD -f "$CONF" $SLURPD_OPTIONS if [ $? -ne 0 ]; then echo "failed." exit $SMF_EXIT_ERR_CONFIG else echo "done." fi fi ;; stop) echo "Use 'svcadm disable openldap/slurpd'" exit $SMF_EXIT_ERR_NOSMF ;; *) echo "Usage: $0 start" exit 1 ;; esac exit $SMF_EXIT_OK