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

View File

@@ -63,6 +63,9 @@ func main() {
svcFlag := flag.String("service", "", "Control the system service.")
flag.Parse()
options := make(service.KeyValue)
options["Restart"] = "on-success"
options["SuccessExitStatus"] = "1 2 8 SIGKILL"
svcConfig := &service.Config{
Name: "GoServiceExampleLogging",
DisplayName: "Go Service Example for Logging",
@@ -70,6 +73,7 @@ func main() {
Dependencies: []string{
"Requires=network.target",
"After=network-online.target syslog.target"},
Option: options,
}
prg := &program{}