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

Finer control over restarting behaviour? #306

Open
hongkongkiwi opened this issue Oct 4, 2022 · 4 comments
Open

Finer control over restarting behaviour? #306

hongkongkiwi opened this issue Oct 4, 2022 · 4 comments
Milestone

Comments

@hongkongkiwi
Copy link
Contributor

hongkongkiwi commented Oct 4, 2022

Is it possible to add a couple of variables for me so I can change the restart behaviour when a service crashes? In my case, it's a modem dialer script which just exits when connection drops.

e.g. I want to attempt to restart 20 times at 10 seconds between each try, THEN 30 seconds between each try forever.

I was thinking to solve it maybe we could add two variables: restart_early_tries and restart_early_sec which allows fine tuning of the behaviour (by default I think it's restart_early_tries:5 restart_early_sec:2 according to the docs).

So that way I could specify the following on a service

restart_early_tries:20 restart_early_sec:10 restart_sec:30 restart:always
@hongkongkiwi
Copy link
Contributor Author

hongkongkiwi commented Oct 4, 2022

Actually I just realised that this won't really solve my problem because in my case my service actually stays up for a while before the connection drops. So I think I need to change the way it works and have my own backoff strategy.

But I do think this is a great idea to implement, because it will allow the user to specify a bit more control over restarting for some services.

@troglobit
Copy link
Owner

It's possible, but I really think this is closing up on being its own daemon with monitoring and restart strategies. Possibly shipped with Finit.

@hongkongkiwi
Copy link
Contributor Author

hongkongkiwi commented Oct 5, 2022

It would definitely make sense to split this out into a separate daemon, it would probably simplify finit a lot. Are you thinking something like restartd on ubuntu? Like a seperate daemon which handles all process restarting?

Or are you thinking to run a wrapper in front of each process which handles reestarting upon crash ?

@troglobit
Copy link
Owner

Heh, never even heard of restartd before. Something like that, yes.

Yup, like a little extra helper/crutch.

@troglobit troglobit added this to the FUTURE milestone Nov 9, 2022
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

2 participants