delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/08/15/15:02:45

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: <1124132511.4300e69f4d736@mail-www2.oit.umass.edu>
Date: Mon, 15 Aug 2005 15:01:51 -0400
From: kandryc AT miser DOT umass DOT edu
To: cygwin AT cygwin DOT com
Subject: RE: OpenLDAP NT Service
References: <200508122250 DOT j7CMnxYd044094 AT unsane DOT co DOT uk>
In-Reply-To: <200508122250.j7CMnxYd044094@unsane.co.uk>
MIME-Version: 1.0
User-Agent: Internet Messaging Program (IMP) 3.2
X-IsSubscribed: yes

Thanks Vince,

I was trying to do this, however, I can't find the documentation on how to add
the sysV init scripts as a service. I think you just add /etc/rc.d/rc.sysinit as
a service using:

# cygrunsrv --install rc.sysinit --path /etc/rc.d/rc.sysinit --disp "CYGWIN sysinit"

Is this correct?

Quoting Vince <jhary AT unsane DOT co DOT uk>:

>  
> > > 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