diff options
Diffstat (limited to 'net-nds/389-ds-base/files/389-ds-snmp.initd')
-rw-r--r-- | net-nds/389-ds-base/files/389-ds-snmp.initd | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/net-nds/389-ds-base/files/389-ds-snmp.initd b/net-nds/389-ds-base/files/389-ds-snmp.initd new file mode 100644 index 000000000000..0e56f8b9cff8 --- /dev/null +++ b/net-nds/389-ds-base/files/389-ds-snmp.initd @@ -0,0 +1,45 @@ +#!/sbin/runscript +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +PIDFILE="/var/run/ldap-agent.pid" +CONFIGFILE="/etc/dirsrv/config/ldap-agent.conf" + +# instance support in progress + +depend() { + need net + use logger snmpd +} + +start() { + ebegin "Starting 389 Directory Server ldap-snmp agent" + start-stop-daemon --start --quiet -b \ + --pidfile ${PIDFILE} --exec /usr/sbin/ldap-agent -- ${CONFIGFILE} + eend ${?} + if [ "${?}" != "0" ]; then + local entries=/etc/dirsrv/slapd-* + if [ -n "${entries}" ]; then + ewarn "Please make sure that ${CONFIGFILE} contains at least" + ewarn "one of the following entries:" + for entry in ${entries}; do + entry=$(basename ${entry}) + ewarn "server ${entry}" + done + fi + fi +} + +stop() { + ebegin "Stopping 389 Directory Server ldap-snmp agent" + start-stop-daemon --stop --quiet --pidfile ${PIDFILE} + eend ${?} + +} + +restart() { + svc_stop + sleep 2 + svc_start +} |