1

I need to create a service for the snmp daemon snmpd.exe which is installed on my windows server 2016. I use sc create snmpd binPath= "C:/path/to/snmpd.exe" and then I try to start it with sc start snmpd but I get the following error:

The service did not respond to the start or control request in a timely fashion.

How can I create a working service for this binary please ? I'm using cygwin with my windows server if it helps.

I do not need to make it work in that exact way, any other solutions are welcome, I just need a working service with this binary.

PS: I only have an ssh access to the server

Thank you.

0

The proper way to install a Cygwin program as service is to use the cygserver utility.

$ cygrunsrv --help
Usage: cygrunsrv [OPTION]...

Main options: Exactly one is required.

  -I, --install <svc_name>  Installes a new service named <svc_name>.
  -R, --remove <svc_name>   Removes a service named <svc_name>.
  -S, --start <svc_name>    Starts a service named <svc_name>.
  -E, --stop <svc_name>     Stops a service named <svc_name>.
  -Q, --query <svc_name>    Queries a service named <svc_name>.
  -L, --list [server]       Lists services that have been installed
                            with cygrunsrv.
  <svc_name> can be a local service or "server/svc_name" or "server\svc_name".
  ....

Any other way will fail to proper execute the program. See for example:
https://stackoverflow.com/questions/52704903/running-cygwin-application-as-a-windows-service?rq=1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.