feat(config): add restart options for unit configuration
* include Restart, RestartSec, and RestartRetries fields * update service file generation to support restart settings * add tests for restart behavior in unit generation
This commit is contained in:
@@ -20,6 +20,9 @@ type Unit struct {
|
||||
Delay string `yaml:"delay,omitempty"` // e.g. "5s"
|
||||
Enabled bool `yaml:"enabled"`
|
||||
DisabledReason string `yaml:"disabled_reason,omitempty"`
|
||||
Restart bool `yaml:"restart,omitempty"` // enable Restart=on-failure
|
||||
RestartSec int `yaml:"restart_sec,omitempty"` // seconds between restarts
|
||||
RestartRetries int `yaml:"restart_retries,omitempty"` // max restart attempts (StartLimitBurst)
|
||||
}
|
||||
|
||||
// Config is the root config structure.
|
||||
|
||||
Reference in New Issue
Block a user