Support the systemd option setting for 'Restart' and 'SuccessExitStatus (#168)

* support the dependency config for linux systemd

* remote the binary file incorrectly added

* Support the systemd option setting for 'Restart' and 'SuccessExitStatus'
This commit is contained in:
Rozen Lin
2019-05-14 08:51:56 -07:00
committed by Daniel Theophanes
parent 61d6d01901
commit fffe6c52ed
3 changed files with 16 additions and 1 deletions
+6 -1
View File
@@ -149,6 +149,8 @@ func (s *systemd) Install() error {
HasOutputFileSupport bool
ReloadSignal string
PIDFile string
Restart string
SuccessExitStatus string
LogOutput bool
}{
s.Config,
@@ -156,6 +158,8 @@ func (s *systemd) Install() error {
s.hasOutputFileSupport(),
s.Option.string(optionReloadSignal, ""),
s.Option.string(optionPIDFile, ""),
s.Option.string(optionRestart, "always"),
s.Option.string(optionSuccessExitStatus, ""),
s.Option.bool(optionLogOutput, optionLogOutputDefault),
}
@@ -260,7 +264,8 @@ ExecStart={{.Path|cmdEscape}}{{range .Arguments}} {{.|cmd}}{{end}}
StandardOutput=file:/var/log/{{.Name}}.out
StandardError=file:/var/log/{{.Name}}.err
{{- end}}
Restart=always
{{if .Restart}}Restart={{.Restart}}{{end}}
{{if .SuccessExitStatus}}SuccessExitStatus={{.SuccessExitStatus}}{{end}}
RestartSec=120
EnvironmentFile=-/etc/sysconfig/{{.Name}}