Discussion on Windows service wrapper

Source: Internet
Author: User

    Windows Services Wrapper (Windows Service wrapper), which registers an. exe file as a Windows service. For example, registering Nginx.exe as a Windows service has the advantage of not having to enter commands on the command line each time you start Nginx, and can start with Windows system startup. Don't worry about the server restarting unexpectedly, the service hangs up.     GitHub address:https://github.com/kohsuke/winsw   : https://github.com/kohsuke/winsw/releases     Current (January 11, 2017) The latest version is 2.0.1 version. There are two options, WinSW.NET2.exe installed in. netframework2.0, WinSW.NET4.exe installed in. netframework4.0, select the files that need to be downloaded according to the installation environment. 1    After the download is complete, it needs to be configured through a configuration file, and the official documentation does not appear to be the most current version of the XML configuration files. Because I use this configuration method, although the ability to register as a service, but can not start, will be reported code 1067 error. The red box in Figure 2 is the incorrect XML file format, as shown in Figure 1 in Sample-minimal.xml or Sample-alloptions.xml.      Use WinSW.NET4.exe for example, download WinSW.NET4.exe, put it in the EXE folder to be packaged, it can customize the name, for example, here we named Nginxservice.exe. The. log files in the diagram are automatically generated after they are started. Most importantly, create a new XML file with the same name in the Nginxservice.exe directory and configure it. As mentioned earlier, the format of the file is shown in Sample-minimal.xml or Sample-alloptions.xml. The simplest format is configured here, and a richer configuration can be viewed in sample-alloptions. where ID and name cannot conflict with other services in the system. After the configuration is complete, install on the command line, nginxservice.exe the Install uninstall command: Nginxservice.exe uninstall  after installation run Services.msc Open Service Viewer,You can see the service    view its properties, which is our configuration information in the configuration file.    

Windows Service Wrapper

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.