Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Message-Id: <200508122250.j7CMnxYd044094@unsane.co.uk>
From: "Vince" <jhary@unsane.co.uk>
To: <cygwin@cygwin.com>
Cc: <kandryc@miser.umass.edu>
Subject: RE: OpenLDAP NT Service
Date: Fri, 12 Aug 2005 23:49:13 +0100
MIME-Version: 1.0
Content-Type: text/plain; 	charset="us-ascii"
Content-Transfer-Encoding: 7bit
In-Reply-To: <20050810153242.GB1238@calimero.vinschen.de>

 
> > However, when I start the service from either the services 
> console or with:
> > 
> > # cygrunsrv --start slapd
> > 
> > It will start and then stop after about 5 seconds. When 
> checking the 
> > Application event log, I found this:
> > 
> > "The description for Event ID ( 0 ) in Source ( slapd ) cannot be 
> > found. The local computer may not have the necessary registry 
> > information or message DLL files to display messages from a remote 
> > computer. You may be able to use the /AUXSOURCE= flag to 
> retrieve this description; see Help and Support for details.
> > The following information is part of the event: slapd : PID 
> 2888 : slapd stopped.."
> > 
> > However, if I manually start it by using the following:
> > 
> > # /usr/sbin/slpad -h ldaps:///
> > 
> > It works fine. Anyone know the reson why it fails? Is there anyway 
> > that it can be run from the init scripts?
> > 

Install the sysV init package and install that to run as a service. That 
way you can run all your cygwin daemons as you would under *nix, using 
init scripts.
(You may have to write an init script of course as a lot of cygwin server 
programs expect to be run via cygrunserv not under init.)
For slapd try this as /etc/rc.d/init.d/slapd
----------------start-------------
#!/bin/bash
#
# Init file for slapd ldap server
#
# chkconfig: 345 35 65
# description: OpenLDAP server daemon
#
# processname: slapd
# config: /etc/openldap/slapd.conf
# pidfile: /var/run/slapd.pid

# source function library
. /etc/rc.d/init.d/functions

# pull in sysconfig settings
[ -f /etc/sysconfig/slapd ] && . /etc/sysconfig/slapd

RETVAL=0
prog="slapd"
SLAPD=/usr/sbin/slapd
PID_FILE=/var/openldap/run/slapd.pid
OPTIONS=""
# Some functions to make the below more readable

start()
{
        echo -n $"Starting $prog:"
        daemon $SLAPD $OPTIONS && success || failure
        RETVAL=$?
        [ "$RETVAL" = 0 ] && touch /var/lock/subsys/slapd
        echo
}

stop()
{
        echo -n $"Stopping $prog:"
        killproc $SLAPD -TERM
        RETVAL=$?
        [ "$RETVAL" = 0 ] && rm -f /var/lock/subsys/slapd
        echo
}

reload()
{
        echo -n $"Reloading $prog:"
        killproc $SLAPD -HUP
        RETVAL=$?
        echo
}

case "$1" in
        start)
                start
                ;;
        stop)
                stop
                ;;
        restart)
                stop
                start
                ;;
        reload)
                reload
                ;;
        status)
                status $SLAPD
                RETVAL=$?
                ;;
        *)
                echo $"Usage: $0
{start|stop|restart|reload|condrestart|status}"
                RETVAL=1
esac
exit $RETVAL
-------------------------end--------------------------------------
(taken from some linux distro or the slapd tarball, I forget which)

Vince




> > Thanks!
> 
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Problem reports:       http://cygwin.com/problems.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
> 


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

