From 71a1b6ed850e8e9949a7856c8f6640b25c20e17d Mon Sep 17 00:00:00 2001 From: Patric Fors Date: Sat, 28 Feb 2015 12:52:59 +0100 Subject: [PATCH 1/2] Add dependencies for Windows Services --- service.go | 11 ++++++----- service_windows.go | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/service.go b/service.go index bcc1d0d..2f26035 100644 --- a/service.go +++ b/service.go @@ -18,7 +18,7 @@ import ( "log" - "github.com/kardianos/service" + "github.com/nollan/service" ) var logger service.Logger @@ -60,7 +60,7 @@ } } */ -package service // import "github.com/kardianos/service" +package service // import "github.com/nollan/service" import ( "errors" @@ -69,9 +69,10 @@ import ( // Config provides the setup for a Service. The Name field is required. type Config struct { - Name string // Required name of the service. No spaces suggested. - DisplayName string // Display name, spaces allowed. - Description string // Long description of service. + Name string // Required name of the service. No spaces suggested. + DisplayName string // Display name, spaces allowed. + Description string // Long description of service. + Dependencies []string // Array of service dependencies. UserName string // Run as username. Arguments []string // Run with arguments. diff --git a/service_windows.go b/service_windows.go index 289a6b2..9092ab6 100644 --- a/service_windows.go +++ b/service_windows.go @@ -195,6 +195,7 @@ func (ws *windowsService) Install() error { StartType: mgr.StartAutomatic, ServiceStartName: ws.UserName, Password: ws.Option.string("Password", ""), + Dependencies: ws.Dependencies, }) if err != nil { return err From dc8c0fa0b7da47f142490816ce2e6ffee1249ff8 Mon Sep 17 00:00:00 2001 From: Patric Fors Date: Sat, 28 Feb 2015 13:21:31 +0100 Subject: [PATCH 2/2] Corrected import path to upstream --- service.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service.go b/service.go index 2f26035..26299bd 100644 --- a/service.go +++ b/service.go @@ -18,7 +18,7 @@ import ( "log" - "github.com/nollan/service" + "github.com/kardianos/service" ) var logger service.Logger @@ -60,7 +60,7 @@ } } */ -package service // import "github.com/nollan/service" +package service // import "github.com/kardianos/service" import ( "errors"