Skip to content

Commit

Permalink
Merge pull request #17 from aelsabbahy/feature/upstart_running
Browse files Browse the repository at this point in the history
Fix Upstart running check
  • Loading branch information
aelsabbahy committed Nov 4, 2015
2 parents fd4f469 + b031126 commit edde73f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion system/service_upstart.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"os"
"regexp"
"strings"

"github.com/aelsabbahy/goss/util"
)
Expand Down Expand Up @@ -58,7 +59,8 @@ func (s *ServiceUpstart) Enabled() (interface{}, error) {
func (s *ServiceUpstart) Running() (interface{}, error) {
cmd := util.NewCommand("service", s.service, "status")
cmd.Run()
if cmd.Status == 0 {
out := cmd.Stdout.String()
if cmd.Status == 0 && (strings.Contains(out, "running") || strings.Contains(out, "online")) {
return true, nil
}
return false, nil
Expand Down

0 comments on commit edde73f

Please sign in to comment.