(ctx context.Context, conf config.Config)
| 71 | } |
| 72 | |
| 73 | func (l processManager) Running(ctx context.Context, conf config.Config) (s Status, err error) { |
| 74 | err = l.host.RunQuiet(osutil.Executable(), "daemon", "status", config.CurrentProfile().ShortName) |
| 75 | if err != nil { |
| 76 | return |
| 77 | } |
| 78 | s.Running = true |
| 79 | |
| 80 | ctx = context.WithValue(ctx, process.CtxKeyDaemon(), s.Running) |
| 81 | |
| 82 | for _, p := range processesFromConfig(conf) { |
| 83 | pErr := p.Alive(ctx) |
| 84 | s.Processes = append(s.Processes, processStatus{ |
| 85 | Name: p.Name(), |
| 86 | Running: pErr == nil, |
| 87 | Error: pErr, |
| 88 | }) |
| 89 | } |
| 90 | return |
| 91 | } |
| 92 | |
| 93 | func (l processManager) Start(ctx context.Context, conf config.Config) error { |
| 94 | _ = l.Stop(ctx, conf) // this is safe, nothing is done when not running |
no test coverage detected