mirror of
https://github.com/kardianos/service.git
synced 2025-10-05 08:46:51 +08:00
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:

committed by
Daniel Theophanes

parent
61d6d01901
commit
fffe6c52ed
@@ -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{}
|
||||
|
Reference in New Issue
Block a user