func NewSvcRunner(backend backends.Backend, context *context.Ctx) Runner {
	r := &SvcRunner{
		RunnerCommon: RunnerCommon{
			name:    backend.Name(),
			context: context,
			backend: backend,
		},
		exec:        backend.ExecPath(),
		args:        backend.ExecArgs(),
		serviceName: "graylog-collector-" + backend.Name(),
		isRunning:   false,
	}

	return r
}
示例#2
0
func (dc *DaemonConfig) NewRunner(backend backends.Backend, context *context.Ctx) *Runner {
	r := &Runner{
		Running: false,
		Context: context,
		Backend: backend,
		Name:    backend.Name(),
		Exec:    backend.ExecPath(),
		Args:    backend.ExecArgs(),
		Stderr:  filepath.Join(context.UserConfig.LogPath, backend.Name()+"_stderr.log"),
		Stdout:  filepath.Join(context.UserConfig.LogPath, backend.Name()+"_stdout.log"),
		Daemon:  dc,
		exit:    make(chan struct{}),
	}

	return r
}
示例#3
0
func NewExecRunner(backend backends.Backend, context *context.Ctx) Runner {
	r := &ExecRunner{
		RunnerCommon: RunnerCommon{
			name:    backend.Name(),
			context: context,
			backend: backend,
		},
		exec:         backend.ExecPath(),
		args:         backend.ExecArgs(),
		isRunning:    false,
		restartCount: 1,
		isSupervised: false,
		signals:      make(chan string),
		stderr:       filepath.Join(context.UserConfig.LogPath, backend.Name()+"_stderr.log"),
		stdout:       filepath.Join(context.UserConfig.LogPath, backend.Name()+"_stdout.log"),
	}

	r.signalProcessor()
	return r
}