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

643 views
Skip to first unread message

Ryan Hamilton

unread,
Oct 11, 2012, 6:55:28 PM10/11/12
to personal...@googlegroups.com
http://code.kx.com/wiki/Cookbook/QAsWindowsService




From: "Sam" <jain....@gmail.com>
Sent: Thursday, October 11, 2012 11:38 PM
To: personal...@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

--
You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/personal-kdbplus/-/CzwokYEmk88J.
To post to this group, send email to personal...@googlegroups.com.
To unsubscribe from this group, send email to personal-kdbpl...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/personal-kdbplus?hl=en.

Sam

unread,
Oct 11, 2012, 11:49:54 PM10/11/12
to personal...@googlegroups.com, k...@ryan-h.com
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?

Sam

unread,
Oct 12, 2012, 6:20:02 PM10/12/12
to personal...@googlegroups.com, k...@ryan-h.com
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              :

Sam

unread,
Oct 13, 2012, 10:33:38 PM10/13/12
to personal...@googlegroups.com, k...@ryan-h.com
Has anyone been able to set this up as a windows service?

thanks

Sam

unread,
Oct 15, 2012, 12:07:06 AM10/15/12
to personal...@googlegroups.com, k...@ryan-h.com
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?


Charles Skelton

unread,
Oct 15, 2012, 5:45:18 AM10/15/12
to personal...@googlegroups.com
On Mon, Oct 15, 2012 at 6:07 AM, Sam <jain....@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
Reply all
Reply to author
Forward
0 new messages