Skip to content

Commit c16ea67

Browse files
committed
fix service stop
1 parent 0e43f98 commit c16ea67

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Service/system-service_windows.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,14 +222,16 @@ func (thisRef *WindowsService) Restart() error {
222222
func (thisRef *WindowsService) Stop() error {
223223
logging.Instance().LogDebugWithFields(loggingC.Fields{
224224
"method": helpersReflect.GetThisFuncName(),
225-
"message": fmt.Sprint("%s: attempting to stop: ", logTag, thisRef.command.Name),
225+
"message": fmt.Sprintf("%s: attempting to stop: %s", logTag, thisRef.command.Name),
226226
})
227227

228228
err := thisRef.control(svc.Stop, svc.Stopped)
229229
if err != nil {
230230
e := err.Error()
231231
if strings.Contains(e, "service does not exist") {
232232
return nil
233+
} else if strings.Contains(e, "service has not been started") {
234+
return nil
233235
}
234236

235237
return err

0 commit comments

Comments
 (0)