Skip to content

Commit

Permalink
fixup naming
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross committed Nov 11, 2019
1 parent f2a4c41 commit 608f4da
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion command/agent/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ WAIT:
select {
case s := <-signalCh:
sig = s
case <-winsvc.Shutdown_Channel():
case <-winsvc.ShutdownChannel():
sig = os.Interrupt
case <-c.ShutdownCh:
sig = os.Interrupt
Expand Down
4 changes: 3 additions & 1 deletion helper/winsvc/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package winsvc

var chanGraceExit = make(chan int)

func Shutdown_Channel() <-chan int {
// ShutdownChannel returns a channel that sends a message that a shutdown
// signal has been received for the service.
func ShutdownChannel() <-chan int {
return chanGraceExit
}
7 changes: 4 additions & 3 deletions helper/winsvc/service_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ func init() {
if interactive {
return
}
go func() {
_ = wsvc.Run("", serviceWindows{})
}()
go wsvc.Run("", serviceWindows{})
}

// Execute implements the Windows service Handler type. It will be
// called at the start of the service, and the service will exit
// once Execute completes.
func (serviceWindows) Execute(args []string, r <-chan wsvc.ChangeRequest, s chan<- wsvc.Status) (svcSpecificEC bool, exitCode uint32) {
const accCommands = wsvc.AcceptStop | wsvc.AcceptShutdown
s <- wsvc.Status{State: wsvc.Running, Accepts: accCommands}
Expand Down

0 comments on commit 608f4da

Please sign in to comment.