minwinsvc

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2018 License: MIT, Zlib Imports: 0 Imported by: 0

README

Minimal windows service stub

Programs designed to run from most *nix style operating systems can import this package to enable running programs as services without modifying them.

import _ "github.com/kardianos/minwinsvc"

If you need more control over the exit behavior, set

minwinsvc.SetOnExit(func() {
	// Do something.
	// Within 10 seconds call:
	os.Exit(0)
})

Documentation

Overview

Package minwinsvc is a minimal non-invasive windows only service stub.

Import to allow running as a windows service.

import _ "github.com/kardianos/minwinsvc"

This will detect if running as a windows service and install required callbacks for windows.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetOnExit

func SetOnExit(f func())

SetOnExit sets the function to be called when the windows service requests an exit. If this is not called, or if it is called where f == nil, then it defaults to calling "os.Exit(0)".

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL