0

I tried running the below command in administrator mode to install nginx as service

nssm install ztestservice "C:\Stack\nginx\nginx.exe"

nssm is installing the service but there is no reference to the application path in the registry. i.e. no parameters are set. When I try to start the service shows error "cant start service".

Please help.

LAX_DEV
  • 2,111
  • 3
  • 19
  • 29

1 Answers1

2

I have been using nssm to run a php script. I find if you run just:

nssm install ztestservice

nssm will pop up a window that lets you set all the other parameters. Otherwise, you can set the parameters separately using the set command:

nssm set <servicename> <parameter> [<subparameter>] <value>

so:

nssm set ztestservice AppParameters "C:\Stack\nginx\nginx.exe"

However, watch out. On windows 2012r2 i'm experiencing an issue where it now hangs on the stop command so i'd watch out for that!

EDIT: You can also run nssm dump ztestservice' will also give you a list of the available parameters EDIT2: (Will i ever stop editing this?)nssm edit ztestservice' to edit the service you just created, changing all params and having them set in the registry.

James
  • 557
  • 7
  • 16