nats-io / nats-server

High-Performance server for NATS.io, the cloud and edge native messaging system.
https://nats.io
Apache License 2.0
16.04k stars 1.41k forks source link

Create a windows service using NSSM and report an error when starting the service #1181

Open evildecay opened 5 years ago

evildecay commented 5 years ago

Defects

Versions of nats-server and affected client libraries used:

gnatsd v1.4.1

OS/Container environment:

windows10 1903 64bit

Steps or code to reproduce the issue:

I am sure there is no problem with the parameters for creating the service. There is no problem executing on the command line. Why is this? Configuration parameters in NSSM: nats_servie

REM start service
nssm.exe start nats

Start error log:

nats: Unexpected status SERVICE_PAUSED in response to START control.

Server log:

The service process could not connect to the service controller.
vimagick commented 9 months ago

telegraf has the same error without --console option when started as a nssm service.

When --console option was added, it works.

Application

I guess that program will run in different mode.

Jarema commented 9 months ago

The new version of nats-server should work just fine, given the example here:

sc.exe create nats-server binPath="%NATS_PATH%\nats-server.exe -js --config %NATS_PATH%\config\server.cfg"

@vimagick Did you hit the problem with nats-server recent version or you just letting us know you saw something similar elsewhere?