nsqio/nsq

nsqd: issues running as a NSSM service or scheduled task on windows

Open

#817 opened on Nov 28, 2016

View on GitHub
 (12 comments) (0 reactions) (0 assignees)Go (25,788 stars) (2,898 forks)batch import
bughelp wanted

Description

Running NSQd 0.3.8 in a user session on Windows works perfectly but running it any other way does not work.

Tested for Schedule Tasks

  • Pointing directly to nsqd.exe
  • Pointing directly to a bat file that starts nsqd.exe
  • Made my own golang program that does os.exec start on nsqd.exe
  • Made my own golang program that starts a bat file that starts nsqd.exe
  • Made a powershell script that uses start-process for nsqd.exe, and to the bad file
  • Have a C# program start nsqd.exe

I can see in the task manager that the process starts for a second and then goes away. In the results in the eventlog for the task is always that it starts "with return code 2147942401.". Google says this could be a permission problem but it does not seem to be the case. Tried running it as SYSTEM, NETWORK SERVICE, LOCAL SERVICE and a specific user. All this works if the scheduled task is set to Run only when user is logged on, then a console window pops up with the stdout information. Nothing works when its set to Run weather user is logged on or not. In my golang app, bat file and powershell script I tested I tried to capture the stdout from NSQd but nothing was ever captured.

Tested for Service

  • Have NSSM configured to point to nsqd.exe
  • Have NSSM configured to point to my golang program
  • Have NSSM configured to point to a bat file

In the NSSM log file it logs: "2016/11/28 11:10:30 The service process could not connect to the service controller."

Contributor guide