zoukankan      html  css  js  c++  java
  • Windows Service Wrapper

    This project creates a wrapper executable that can be used to host any executable as an Windows service.

    Download

    The binaries are available here for download.

    Usage

    During your development...

    1. Take winsw.exe from the distribution, and rename it to your taste (such as myapp.exe)
    2. Write myapp.xml (see Configuration Syntax for more details)
    3. Place those two files side by side when you deploy your application, because that's how winsw.exe discovers its configuration.

    At runtime...

    • To install a service, run myapp.exe install
    • To start a service, run myapp.exe start
    • To stop a service, run myapp.exe stop
    • To restart a service, run myapp.exe restart
    • To uninstall a service, run myapp.exe uninstall

    When there's a problem, these commands also report an error message to stderr. On a successful completion, these commands do no produce any output and exit with 0.

    In addition, you can also run myapp.exe status to have it print out the current status of the service to stdout. Again, any error encountered during the processing would cause output to be reported to stderr.

    All these commands use the same set of exit code to indicate its result.

    Deferred File Operations

    To support self updating services, winsw offers a mechanism to perform file operations before a service start up. This is often necessary because Windows prevents files from overwritten while it's in use.

    To perform file operations, write a text file (in the UTF-8 encoding) at myapp.copies (that is, it's in the same directory asmyapp.xml but with a different file extension), and for each operation add one line:

    • To move a file, write "src>dst". If the 'dst' file already exists it will be overwritten.

    The success or failure of these operations will be recorded in the event log.

  • 相关阅读:
    linux 静态库和动态库(共享库)的制作与使用(注意覆盖问题)转
    手机号码格式正则表达式
    项目去除TFS关联、迁移重部署
    Excel中VLOOKUP函数的用法和注意点
    自定义打赏插件
    分享一个无需注册,无次数限制的Smile聊天机器人接口
    TCP/IP
    Java字典树
    平衡二叉树结构 AVL
    二叉搜索树(二叉排序树)BST
  • 原文地址:https://www.cnblogs.com/rongfengliang/p/5297831.html
Copyright © 2011-2022 走看看