Skip to content

Commit

Permalink
Allow specifying 'all' for process auto restarts (DarthSim#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
dunkmann00 authored Sep 15, 2023
1 parent f95d245 commit 7f78ffd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,13 @@ $ overmind start -r rails,webpack
$ OVERMIND_AUTO_RESTART=rails,webpack overmind start
```

The special name `all` can also be used to restart all processes automatically when they die:

```bash
$ overmind start -r all
$ OVERMIND_AUTO_RESTART=all overmind start
```

#### Specifying the colors

Overmind colorizes process names with different colors. It may happen that these colors don't match well with your color scheme. In that case, you can specify your own colors using xterm color codes:
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func setupStartCmd() cli.Command {
cli.BoolFlag{Name: "no-port, N", EnvVar: "OVERMIND_NO_PORT", Usage: "Don't set $PORT variable for processes", Destination: &c.NoPort},
cli.StringFlag{Name: "can-die, c", EnvVar: "OVERMIND_CAN_DIE", Usage: "Specify names of process which can die without interrupting the other processes. Divide names with comma", Destination: &c.CanDie},
cli.BoolFlag{Name: "any-can-die", EnvVar: "OVERMIND_ANY_CAN_DIE", Usage: "No dead processes should stop Overmind. Overrides can-die", Destination: &c.AnyCanDie},
cli.StringFlag{Name: "auto-restart, r", EnvVar: "OVERMIND_AUTO_RESTART", Usage: "Specify names of process which will be auto restarted on death. Divide names with comma", Destination: &c.AutoRestart},
cli.StringFlag{Name: "auto-restart, r", EnvVar: "OVERMIND_AUTO_RESTART", Usage: "Specify names of process which will be auto restarted on death. Divide names with comma. Use 'all' as a process name to auto restart all processes on death.", Destination: &c.AutoRestart},
cli.StringFlag{Name: "colors, b", EnvVar: "OVERMIND_COLORS", Usage: "Specify the xterm color codes that will be used to colorize process names. Divide codes with comma"},
cli.BoolFlag{Name: "show-timestamps, T", EnvVar: "OVERMIND_SHOW_TIMESTAMPS", Usage: "Add timestamps to the output", Destination: &c.ShowTimestamps},
cli.StringFlag{Name: "formation, m", EnvVar: "OVERMIND_FORMATION", Usage: "Specify the number of each process type to run. The value passed in should be in the format process=num,process=num. Use 'all' as a process name to set value for all processes"},
Expand Down
2 changes: 1 addition & 1 deletion start/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func newCommand(h *Handler) (*command, error) {
scriptFilePath,
c.output,
(h.AnyCanDie || utils.StringsContain(canDie, e.OrigName)),
utils.StringsContain(autoRestart, e.OrigName),
(utils.StringsContain(autoRestart, e.OrigName) || utils.StringsContain(autoRestart, "all")),
e.StopSignal,
))
}
Expand Down

0 comments on commit 7f78ffd

Please sign in to comment.