3

I am running a Kx Q process on my Linux server

I notice that when I run this command that after I hit return/enter on my shell that the process stops

./kdb/q/l32/q -p 1234 &

However, if I run this in the foreground...

./kdb/q/l32/q -p 1234

It opens up a q) prompt that hitting return/enter does not cause it to exit

I am wondering if hitting enter causing the process to stop is something related to Kx, or if its Linux related?

Any advice is appreciated

Thomas Smyth - Treliant
  • 4,993
  • 6
  • 25
  • 36
DJ180
  • 18,724
  • 21
  • 66
  • 117
  • A background process trying to read from the terminal will be suspended. Is there a daemon or background or headless option to run it as a service? I did a quick search and found `-s slaves for parallel execution` which doesn't seem quite right, but your basic problem is trying to read from the terminal. In the foreground that is not a problem, but in the background it will suspend and wait for you to bring it to the foreground so you can respond to the prompt. – Stephen P Jan 30 '18 at 21:18
  • Thanks @StephenP. The strange thing is though is that it will work fine in the background but once I hit enter it stops – DJ180 Jan 30 '18 at 21:21
  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. – jww Jan 31 '18 at 00:21

1 Answers1

4

You should use nohup to execute the command in background. For example

nohup ./kdb/q/l32/q -p 1234 &
Anton Dovzhenko
  • 2,399
  • 11
  • 16