Registering Directory Server Enterprise Edition 7.0 With Windows Services

Download DSEE free of charge This entry covers registering servers and components as Windows Services, so you no longer need to start them by hand on reboot.

  1. Install as described in Installing Directory Server Enterprise Edition 7.0.

  2. Log on as Administrator or a member of the local group of Administrators.

  3. Register Directory Server instances.

    This same procedure also works with dpadm for Directory Proxy instances.

    C:\\Program Files\\Sun\\dsee7\\bin>dsadm stop C:\\DirectoryServer
    Directory Server instance 'C:/DirectoryServer' stopped
    
    C:\\Program Files\\Sun\\dsee7\\bin>dsadm enable-service --type WIN_SERVICE C:\\DirectoryServer
    Instance C:/DirectoryServer registered in WIN_SERVICE
    
    C:\\Program Files\\Sun\\dsee7\\bin>dsadm info C:\\DirectoryServer
    Instance Path:                 C:/DirectoryServer
    Non-secure port:               1389
    Secure port:                   1636
    Bit format:                    32-bit
    State:                         Stopped
    DSCC url:                      -
    Windows service registration:  Enabled
    Instance version:              D-A10

    Do not forget the DSCC Registry instance.

    C:\\Program Files\\Sun\\dsee7\\bin>dsadm stop ..\\var\\dcc\\ads
    Directory Server instance 'C:/Program Files/Sun/dsee7/var/dcc/ads' stopped
    
    C:\\Program Files\\Sun\\dsee7\\bin>dsadm enable-service --type WIN_SERVICE ..\\var\\dcc\\ads
    Instance C:/Program Files/Sun/dsee7/var/dcc/ads registered in WIN_SERVICE
  4. Register your Application Server as a Windows Service.

    How to do this depends on your Application Server. With GlassFish this was so easy I have already forgotten.

  5. Register the Common Agent Container as a Windows Service.

    C:\\Program Files\\Sun\\dsee7\\bin>cacaoadm enable --instance default --file pwd.txt

    The pwd.txt file contains the password of the current user, such as Administrator.


    Important Note: As of this writing, Nov. 20, 2009, Sun is still working on an issue with Common Agent Container in DSEE 7.0 that can crash upon system restart. So until there's a service pack for that, you will need to restart the Common Agent Container by hand after reboot.


    For belt-and-suspenders style administration, after this works you can also provide the password through the Log On tab of the Properties window for the Common Agent Container service in the Services management console. (Run... services.msc)
Comments:

Mark,

thanks for this blog entry!
But there is a bug in "dsadm enable-service --type WIN_SERVICE" on Windows.
You must be a local user and this user must be a direct member of the local group "Administrators"!
\* A Windows domain user is not working
\* Also nested groups are not working

Greetings Stefan

Posted by Stefan on August 12, 2010 at 09:53 AM CEST #

You can also create your Windows service by following these steps:

1. Create a batch file which you can use to start the services. The same command lines input into a txt file and call it with the extension of .bat will suffice in windows.

example - C:\\dsee\\startds.bat

2. Now make this batch file run as service. To do this follow along:

1. C:\\"Program Files"\\"Windows Resource Kits"\\Tools\\Instsrv.exe SunOneLDAP C:\\"Program Files"\\"Windows Resource Kits"\\Tools\\Srvany.exe

This should create a service by name SunOneLDAP

2. Run Registry Editor (Regedt32.exe)and locate the following subkey:

HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\SunOneLDAP

3. From the Edit menu, click Add Key. Type the following and click OK:

Key Name: Parameters
Class : <leave blank>

4.Select the Parameters key.

From the Edit menu, click Add Value. Type the following and click OK:

Value Name: Application
Data Type : REG_SZ
String : c:\\winnt\\system32\\cmd.exe /c C:\\dsee\\startds.bat

PS: You are now callingthe startds.bat file here.

5. Verify you see the service and that you can start it.

There is a catch here, that when you click to stop the service, it will not actually stop the DS instances, as this is only for the start in the batch file. You can create an additional one for stop or explicitly name your service as start only service..what ever is convenient. You can simply create a stopds.bat file and just run that when you need to stop the DS alternatively.

Posted by Raghu Srinivasan on September 08, 2010 at 09:14 PM CEST #

I did some research on this topic.
It appears that the install user is not allowed to be member in more than 17 groups (quite annoying)! Otherwise you get a message "Only root can ..."

Best practice: install the ds services with sc.exe.
Example for an installation in c:\\dsee7\\

sc create DirectoryServer7-1 binpath= "\\"c:\\dsee7\\lib\\bin\\dsee_ntservice.exe\\" run DirectoryServer7 \\"c:/dsee7/dsInst\\"" displayname= "Directory Server 7.0 (c:/dsee7/dsInst)" start= auto

sc create DirectoryServer7-2 binpath= "\\"c:\\dsee7\\lib\\bin\\dsee_ntservice.exe\\" run DirectoryServer7 \\"c:/dsee7/var/dcc/ads\\"" displayname= "Directory Server 7.0 (c:/dsee7/var/dcc/ads)" start= auto

Note: "A space is required between the equal sign and the value." for the sc.exe options.
And with the sc installation there is no dependency to the winmgmt service and no description either. In contrast to the "dsadm.exe enable-service --type WIN_SERVICE" installation. But you can add the registry values DependOnService(REG_MULTI_SZ)=winmgmt and Description(REG_SZ) with regedit.exe.

Posted by Stefan on September 24, 2010 at 12:26 PM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Mark Craig writes about Directory Services products and technologies. The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today