diff options
Diffstat (limited to 'pkg/helper/windows_service.go')
-rw-r--r-- | pkg/helper/windows_service.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/pkg/helper/windows_service.go b/pkg/helper/windows_service.go index df79d68..3675249 100644 --- a/pkg/helper/windows_service.go +++ b/pkg/helper/windows_service.go @@ -8,6 +8,7 @@ package helper import ( "fmt" + "log" "golang.org/x/sys/windows/svc" "golang.org/x/sys/windows/svc/debug" @@ -22,13 +23,17 @@ func (m *myservice) Execute(args []string, r <-chan svc.ChangeRequest, changes c const cmdsAccepted = svc.AcceptStop | svc.AcceptShutdown | svc.AcceptPauseAndContinue changes <- svc.Status{State: svc.StartPending} changes <- svc.Status{State: svc.Running, Accepts: cmdsAccepted} - go runCommandServer(httpBindAddr) + + // defined in helper.go + // TODO should have a way to stop it -- + //go serveHTTP("localhost:7171") + log.Println("serving>>", httpServerConf.BindAddr) + go serveHTTP(httpServerConf.BindAddr) loop: for { select { case c := <-r: switch c.Cmd { - // TODO start?? case svc.Interrogate: changes <- c.CurrentStatus case svc.Stop, svc.Shutdown: @@ -44,6 +49,9 @@ loop: } func runService(name string, isDebug bool) { + + log.Println("Running service...") + var err error if isDebug { elog = debug.New(name) |