Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux Systemd Script 'RestartSec' is hard-coded #375

Open
shaheerem opened this issue Jun 23, 2023 · 0 comments
Open

Linux Systemd Script 'RestartSec' is hard-coded #375

shaheerem opened this issue Jun 23, 2023 · 0 comments

Comments

@shaheerem
Copy link

shaheerem commented Jun 23, 2023

Hi,
In file service_systemd_linux.go Line 319, you can see that the RestartSec Param is hard-coded to 120s.
This is an issue when you want your service to be set at a custom restart interval.
I have updated the code locally, and tested it out too, I will put the file it created here, and the PR which updates the code too.

[Unit]
Description=ZT-Connector
ConditionFileIsExecutable=connector


[Service]
StartLimitInterval=5
StartLimitBurst=10
ExecStart=connector "run"







Restart=on-failure

RestartSec=10
EnvironmentFile=-/etc/sysconfig/zt-connector

[Install]
WantedBy=multi-user.target
`
Config Provided to make this:

`	
return &k_service.Config{
		Name:        connector.Name,
		DisplayName: connector.DisplayName,
		Description: connector.Description,
		Option: k_service.KeyValue{
			"Restart":                "on-failure", // for linux
			"RestartSec":             "10",
		},
	}

heres the PR
#374

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant