delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/08/12/18:49:10

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-Id: <200508122250.j7CMnxYd044094@unsane.co.uk>
From: "Vince" <jhary AT unsane DOT co DOT uk>
To: <cygwin AT cygwin DOT com>
Cc: <kandryc AT miser DOT umass DOT edu>
Subject: RE: OpenLDAP NT Service
Date: Fri, 12 Aug 2005 23:49:13 +0100
MIME-Version: 1.0
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019