re: [personal kdb+] start KDB Server in non-interactive mode

http://code.kx.com/wiki/Cookbook/QAsWindowsService


From : “Sam” <jain.samit@gmail.com>
Sent : Thursday, October 11, 2012 11:38 PM
To : personal-kdbplus@googlegroups.com
Subject : [personal kdb+] start KDB Server in non-interactive mode

Hi,
How do I run my KDB server in non interactive mode in the background as a Windows service? I think the native windows service will fail because it runs in interactive mode.

thanks


Submitted via Google Groups

I followed the steps exactly and get this error. I think it has something to do with the interactive nature of Q. Has anyone does this successfully?

Sorry the error didn’t show up as an image -

When I Start the service, I get this error :

“The q5010 service on Local Computer started and then stopped. Some services stop automatically if they have no work to do”

F:\>sc start q5010

SERVICE_NAME: q5010

        TYPE               : 10  WIN32_OWN_PROCESS

        STATE              : 1  STOPPED

                                (NOT_STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN))

        WIN32_EXIT_CODE    : 0  (0x0)

        SERVICE_EXIT_CODE  : 0  (0x0)

        CHECKPOINT         : 0x0

        WAIT_HINT          : 0x0

        PID                : 0

        FLAGS              :

Has anyone been able to set this up as a windows service?

thanks

Ok, so finally I was able to resolve the issues and start KDB server. There were some issues with logs on win 7.

I am still unable to get the server to load a file on startup which is required to load my databases. I followed the directions and set my registry as follows:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\q5010\Parameters]

“Application”=“c:\WINDOWS\system32\cmd.exe”

“AppParameters”=“/c c:\q\w32\q.exe "c:\kdb\test.q” -p 5010 -q"

“AppDirectory”=“c:\q”

test.q just has one line in it:

\l c:\kdb\db

But it is not loading the database. When I just run ’ c:\q\w32\q.exe  "c:\kdb\test.q" -p 5010 -q’ on command line, it works fine.

Any ideas?

On Mon, Oct 15, 2012 at 6:07 AM, Sam <jain.samit@gmail.com> wrote:

Ok, so finally I was able to resolve the issues and start KDB server. There were some issues with logs on win 7.

Are these issues specific to your usage/system or ones that we should document? If the latter, please share.

 

I am still unable to get the server to load a file on startup which is required to load my databases. I followed the directions and set my registry as follows:

“AppParameters”=“/c c:\q\w32\q.exe "c:\kdb\test.q” -p 5010 -q"

 

If the process is starting and is reachable, you might gain some insight as to what’s wrong by looking at .z.f (the script passed on the command line), and also .z.x, the cmd line params received by kdb+.

thanks