Skip to content

Commit

Permalink
Merge pull request #19 from bitnami/gonit-ppid-fix
Browse files Browse the repository at this point in the history
Gonit should set a different PPID for processes started by it
  • Loading branch information
marcosbc authored Apr 28, 2020
2 parents 9e020b3 + f205ab6 commit 6a59ef4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/bitnami/gonit/cmd"
)

var version = "0.2.3"
var version = "0.2.4"
var buildDate = ""
var commit = ""

Expand Down
6 changes: 5 additions & 1 deletion monitor/checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"strconv"
"strings"
"sync"
"syscall"
"time"

"github.com/bitnami/gonit/log"
Expand Down Expand Up @@ -334,7 +335,10 @@ func newCommand(cmdStr string, timeout time.Duration, opts Opts) *Command {
func (c *Command) Exec() {
// TODO REPORT error, track std streams
c.logger.Debugf("/bin/bash -c %s", c.Cmd)
c.logger.Debug(exec.Command("/bin/bash", "-c", c.Cmd).Run())

cmd := exec.Command("/bin/bash", "-c", c.Cmd)
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
c.logger.Debug(cmd.Run())
}

func formatColumns(len int, args ...interface{}) string {
Expand Down

0 comments on commit 6a59ef4

Please sign in to comment.