Derby
  1. Derby
  2. DERBY-187

Starting derby network server as a service in Win OS

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.0.2.1
    • Fix Version/s: None
    • Component/s: Services
    • Labels:
      None
    • Environment:
      OS will be only any flavour of Windows.

      Description

      The Derby Network Server Database could be started/stopped as a service in Windows OS.
      This may involve updating the win registry. Further work needs to be done to understand what all will it require to do such a thing.

      I am putting below Andrew McIntyre's comments if they can help in getting a solution to this problem.

      If you would like to see this functionality added, please add a JIRA entry for it. The easiest way to do this would be to provide a registry key file for Derby Network Server and provide instructions on how to install it as a Windows service using instsrv and srvany. However, we obviously can't redistribute those two utilities, but it would be nice to provide all the parts to the solution. So, a little searching turned up this public domain srvany replacement:

      http://iain.cx/src/nssm/

      I haven't tried it, but I suggest trying it out to see how well it works.

        Activity

        Hide
        Andrew McIntyre added a comment -

        Another, probably better solution than my previous suggestion would be one based around the Jakarta Commons Daemon project, which lives here:

        http://jakarta.apache.org/commons/daemon/

        andrew

        Show
        Andrew McIntyre added a comment - Another, probably better solution than my previous suggestion would be one based around the Jakarta Commons Daemon project, which lives here: http://jakarta.apache.org/commons/daemon/ andrew
        Hide
        Riyaz Mansoor added a comment -

        Guys i think this needs to be implemented. Recently Tomcat did the same for their project. Please vote for this feature.

        Riyaz

        Show
        Riyaz Mansoor added a comment - Guys i think this needs to be implemented. Recently Tomcat did the same for their project. Please vote for this feature. Riyaz
        Hide
        Tomohito Nakayama added a comment -

        I tried sc.exe command in Windows XP ...

        Result was as next.

        C:\Documents and Settings????>sc create derby binPath= "C:\j2sdk1.4.2_05\bin\java.exe -classpath C:\work\20061015\db-derby-10.2.1.6-bin\lib\derby.jar;C:\work\20061015\db-derby-10.2.1.6-bin\lib\derbynet.jar org.apache.derby.drda.NetworkServerControl start" DisplayName= derby
        [SC] CreateService SUCCESS

        C:\Documents and Settings????>sc start derby
        [SC] StartService FAILED 1053:

        It seems that just running NetworkServer program is not resulted to run as service ...
        I think somewhat like & in unix is needed ...

        Show
        Tomohito Nakayama added a comment - I tried sc.exe command in Windows XP ... Result was as next. C:\Documents and Settings????>sc create derby binPath= "C:\j2sdk1.4.2_05\bin\java.exe -classpath C:\work\20061015\db-derby-10.2.1.6-bin\lib\derby.jar;C:\work\20061015\db-derby-10.2.1.6-bin\lib\derbynet.jar org.apache.derby.drda.NetworkServerControl start" DisplayName= derby [SC] CreateService SUCCESS C:\Documents and Settings????>sc start derby [SC] StartService FAILED 1053: It seems that just running NetworkServer program is not resulted to run as service ... I think somewhat like & in unix is needed ...
        Hide
        Bryan Pendleton added a comment -

        This is a nice tool for running a Java program as a Windows Service:
        http://wrapper.tanukisoftware.org/

        Show
        Bryan Pendleton added a comment - This is a nice tool for running a Java program as a Windows Service: http://wrapper.tanukisoftware.org/
        Hide
        Tomohito Nakayama added a comment -

        I took a glance through the Jakarta Commons Daemon project and found name "procrun".

        Now we have three options ...

        Show
        Tomohito Nakayama added a comment - I took a glance through the Jakarta Commons Daemon project and found name "procrun". Now we have three options ... http://iain.cx/src/nssm/ http://jakarta.apache.org/commons/daemon/procrun.html http://wrapper.tanukisoftware.org/
        Hide
        Tomohito Nakayama added a comment -

        Reading around informations at Commons Daemon,
        procrun seems to need some of coding/building ...

        At least, I couldn't find binary of procrun.

        Show
        Tomohito Nakayama added a comment - Reading around informations at Commons Daemon, procrun seems to need some of coding/building ... At least, I couldn't find binary of procrun.
        Hide
        Tomohito Nakayama added a comment -

        I found that tomcat5.exe in Tomcat package is binary of procrun.

        I could register DerbyNetServer as Windows service using next command.

        tomcat5.exe //IS//Derby --DisplayName="derby" --StartMode=jvm --StopMode=exe --StartClass=org.apache.derby.drda.NetworkServerControl --StartParams=start --Classpath=C:\work\20061015\db-derby-10.2.1.6-bin\lib\derby.jar;C:\work\20061015\db-derby-10.2.1.6-bin\lib\derbynet.jar --Jvm=C:\j2sdk1.4.2_05\jre\bin\server\jvm.dll --StopClass=org.apache.derby.drda.NetworkServerControl --StopParams=shutdown

        Show
        Tomohito Nakayama added a comment - I found that tomcat5.exe in Tomcat package is binary of procrun. I could register DerbyNetServer as Windows service using next command. tomcat5.exe //IS//Derby --DisplayName="derby" --StartMode=jvm --StopMode=exe --StartClass=org.apache.derby.drda.NetworkServerControl --StartParams=start --Classpath=C:\work\20061015\db-derby-10.2.1.6-bin\lib\derby.jar;C:\work\20061015\db-derby-10.2.1.6-bin\lib\derbynet.jar --Jvm=C:\j2sdk1.4.2_05\jre\bin\server\jvm.dll --StopClass=org.apache.derby.drda.NetworkServerControl --StopParams=shutdown
        Hide
        Tomohito Nakayama added a comment -

        Seeing result of sc command, I came to think that some of program should be included in derby to make it possible to run NetworkServer as service.

        Considering license issue, procrun may be appropriate for that because it also is under apache software license ...

        ... Is it impossible to include tomcat5.exe as derby.exe ?

        Show
        Tomohito Nakayama added a comment - Seeing result of sc command, I came to think that some of program should be included in derby to make it possible to run NetworkServer as service. Considering license issue, procrun may be appropriate for that because it also is under apache software license ... ... Is it impossible to include tomcat5.exe as derby.exe ?
        Hide
        Tomohito Nakayama added a comment -

        I posted question above to legal-discuss@apache.org.

        Show
        Tomohito Nakayama added a comment - I posted question above to legal-discuss@apache.org.
        Show
        Tomohito Nakayama added a comment - It seems that the program can be included in derby... http://mail-archives.apache.org/mod_mbox/www-legal-discuss/200610.mbox/%3c4534E39A.6080908@basil.ocn.ne.jp%3e http://mail-archives.apache.org/mod_mbox/www-legal-discuss/200610.mbox/%3cc5e632550610171157v13c2b506r72678a1934e71313@mail.gmail.com%3e
        Hide
        Andrew McIntyre added a comment -

        It's been a while but I finally got around to looking into it. It appears even the commons-dev folks don't have any forthcoming answers as to why there's no Win32 download for the Commons Daemon:

        http://www.nabble.com/-daemon--Re%3A-Obtaining-procrun-for-Win32-tf2558402.html#a7129565
        http://mail-archives.apache.org/mod_mbox/jakarta-commons-user/200606.mbox/%3C7.0.1.0.0.20060613234131.04c53c98@visi.com%3E

        I think at this point it should be sufficient to point users to the Tomcat distributions and provide some basic instructions on how to extract, rename, and configure tomcat5.exe to run the network server as a service on Windows. These instructions could be added to the FAQ and/or the wiki and then DERBY-187 can be closed.

        Show
        Andrew McIntyre added a comment - It's been a while but I finally got around to looking into it. It appears even the commons-dev folks don't have any forthcoming answers as to why there's no Win32 download for the Commons Daemon: http://www.nabble.com/-daemon--Re%3A-Obtaining-procrun-for-Win32-tf2558402.html#a7129565 http://mail-archives.apache.org/mod_mbox/jakarta-commons-user/200606.mbox/%3C7.0.1.0.0.20060613234131.04c53c98@visi.com%3E I think at this point it should be sufficient to point users to the Tomcat distributions and provide some basic instructions on how to extract, rename, and configure tomcat5.exe to run the network server as a service on Windows. These instructions could be added to the FAQ and/or the wiki and then DERBY-187 can be closed.

          People

          • Assignee:
            Unassigned
            Reporter:
            Amit Handa
          • Votes:
            5 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development