Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

So I need to run a custom server. It worked on other machines, but not on mine (all of them are on Windows).

My input:

nssm start custom-server

Error message:

custom-server: Unexpected status SERVICE_PAUSED in response to START control.

I tried to re-start it, but got the same message.

The problem should be the installation command. What is your install command ? Do you execute it in cmd or in script like batch file ? – Garric Dec 15, 2016 at 18:53

Use the following instructions to change I/O redirects:

nssm set [SERVICE_NAME] AppStdout [APP_PATH_INSTALL]\logs\service.log
nssm set [SERVICE_NAME] AppStderr [APP_PATH_INSTALL]\logs\service-error.log

Check the service log files to find the failure.

In my case, the failure was caused by a dependency on Python libraries.

Thanks! This helped me find the issue. In my case, it was that there was a problem with the quote escaping on my file path. To simplify things, I just moved it to a path that didn't have spaces so I could omit the quotes. – Taraz Jul 8, 2020 at 19:33 Note: if you enter a plain logfile name like "service.log", nssm will give an error in the system event viewer like "Registry key AppDirectory is unset for service <servicename>. Assuming startup directory C:\WINDOWS." – Brian Burns Feb 9, 2022 at 21:31

As Garric15 states it is probably your install command.

This could be for example a StdOut redirect to a path / file that does not exist on your local machine.

Look in the Application event log for errors where the source is nssm around the time you installed the service.

I have the same problem, and there are no errors in the install command. It happens when starting more than ~16 services. The first ~16 start successfully, and then the rest start as "paused". – alexchandel Mar 20, 2019 at 21:03 Bizarrely, while this consistently happens for both LocalSystem and NetworkService, changing the logon to Administrator solves it. – alexchandel Mar 20, 2019 at 21:40 I got the same problem, eventually I found that the my "custom-server" was faulty and could not start. Starting "custom-server" on its own revealed the real culprit. – Evelino Bomitali May 13, 2019 at 20:00

It's probably a bad syntax/entry somewhere along your code, could be an issue with the path or arguments, I'd test the service manually a bunch before putting on NSSM, make sure you have the correct flags/options You can also set Standard Output through NSSM and that would give you a clue of what's going on. If there's anything that'd interrupt the dependencies for that service to run, you'd also get that error.

This is how I install a service using NSSM with Powershell (make sure nssm is added to the PATH):

nssm.exe install "SERVICE NAME" "PATH TO FILE"
nssm.exe set "SERVICE NAME" AppParameters "<CHECK YOUR FILE OPTIONS>"
nssm.exe set "SERVICE NAME" AppStderr "PATH TO SAVE OUTPUT"
nssm.exe start "SERVICE NAME"

If you or anyone happens to see this post and need assistance, I can probably help you, just post more details on what needs to be done and what you're EXACTLY trying to do.

In my case, the problem was that after the service was installed using nssm.exe, the program name was changed. This caused service to always go to paused state after start or restart the service, using either services.msc or nssm.exe command line. Editing service nssm.exe startup parameters solved the problem for me.

  • App directory not provided or doesn't exist

    nssm nssm set xyz-service AppDirectory "D:\Work\ShoppingKart"
    
  • File which is given for service may be corrupted (rebuild code)

  • The application trying to run is not proper or corrupted. Try to run without windows service once.

  • Program (.exe) file path not found (in this case look for the solution, or else give full path, if java not found even if it is there in env, just add full path)

    I solved it by using no mws (Managed Windows Service?) release,

    gogs_0.12.10_windows_amd64 works

    gogs_0.12.10_windows_amd64_mws not working

    Thanks for contributing an answer to Stack Overflow!

    • Please be sure to answer the question. Provide details and share your research!

    But avoid

    • Asking for help, clarification, or responding to other answers.
    • Making statements based on opinion; back them up with references or personal experience.

    To learn more, see our tips on writing great answers.

  •