This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: OpenLDAP NT Service


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@unsane.co.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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]