| 1 | ### Minimal windows service stub |
| 2 | |
| 3 | Programs designed to run from most *nix style operating systems |
| 4 | can import this package to enable running programs as services without modifying |
| 5 | them. |
| 6 | |
| 7 | ``` |
| 8 | import _ "github.com/kardianos/minwinsvc" |
| 9 | ``` |
| 10 | |
| 11 | If you need more control over the exit behavior, set |
| 12 | ``` |
| 13 | minwinsvc.SetOnExit(func() { |
| 14 | // Do something. |
| 15 | // Within 10 seconds call: |
| 16 | os.Exit(0) |
| 17 | }) |
| 18 | ``` |