What is the cleanest and most reliable way to run a Windows application as a service without touching its code?
Use case: The northern version of the 64-bit version of Microsoft memcached works as a general application. I would like to use it in a Windows 2003 or 2008 service so that I can start / stop / restart / etc. Via the standard interface.
The Windows Resource Kit has any executable file srvany.exethat can be used as described here to run basically any exe as a service. The setup is a bit confusing (registry editing is required), but it should work for most things that can run as user applications.
srvany.exe
If you cannot change the application, there are a bunch of "run as a service" wrappers.I used cygrunsrv.exe, I think it works with executables without cygwin.
If you cannot change the code, you cannot directly launch the application as a service. However, it shouldn't be difficult to make a Win32 service - it all revolves around calling a single api: StartServiceCtrlDispatcher . In response to the commands from the service control manager, your wrapper service created CreateProcess, etc. In memcached application.
Source: https://habr.com/ru/post/1746273/More articles:Turn ImageView updates into ProgressBar - androidSQLite trigger for updating consolidated accounts - sqliteExample DNS Protocol Message - dnsProblem with import java.nio.file - javaHow to convert the Emacs Md command to the Mb, Md macro? - emacsUsing MVC2 to update an Entity Framework v4 object using foreign keys - entity-frameworkDisplay HTML content on top of applet - is wmode transparent? - javaHow can I adjust the transparency of a Java applet to display content behind it? - javaThe Link Between Two Firefox Add-Ons (Tier Link) - firefoxHow to write multiple files from one NSData object? - iphoneAll Articles