-
Notifications
You must be signed in to change notification settings - Fork 40
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
Add configuration to determine agent behavior policy when network connection is lost #954
Comments
@dofmind Thank you for opening this RFE issue! Can you provide more context on what the systemd services with the dependency on I issue #858 is similar to this RFE. The solution proposed in that issue can be extended/adjusted to also solve this use case, I think: We'd have a (really) small C program which checks and listens on changes of the Status property of the agent. If it detects that the agent is offline, it simply exits.
@dofmind What do you think about this approach? It requires more effort to implement, but has the advantage of explicitly mapping the bluechi-agent's online/offline status to a systemd unit (and maybe .target if needed). |
I agree with your comment. As you said, my solution can't handle it if bluechi-agent is terminated for any reason other than disconnection. There is a requirement that when a node running bluechi-agent is disconnected, running units of the node should be terminated, because they will be re-executed on another node.
Looks good to me. It has the advantage of only handling disconnection case of bluechi-agent. |
@engelmi I'm trying to add a small C program to the client with following bluechictl command:
The wait-for is a command to wait BlueChi Agent to be the desired status - offline or online. |
I think it should even be a completely new program, e.g. $ bluechi-is-online --help
bluechi-is-online [agent|node|system] [OPTIONS]
If online, exit with 0. Otherwise 1.
Options:
--monitor: keeps monitoring as long as agent|node|system is online. Will only exit if offline detected.
--initial-wait: in seconds. If not online, then monitor n seconds. The systemd unit would then be using it like this: [Unit]
UpheldBy=bluechi-agent.service
...
[Service]
# will keep it in "activating" state. if it fails, will be restarted by bluechi-agent.service
ExecStartPre=/usr/bin/bluechi-is-online --initial-wait=2
ExecStart=/usr/bin/bluechi-is-online --monitor One reason for not adding it to an existing program like |
Actually, I tried to reuse the code of bluechictl, but it seems more reasonable to create a new program. Thanks for the guide. |
@dofmind Thank you for the good discussion and refining this RFE. |
I don't have time to do it right now. And I think your members can do it better than me :) |
Please describe what you would like to see
When the network connection is lost, the current agent behavior is to disconnect and keep trying to reconnect. I would like to add another agent behavior where the agent terminates with a failure. Then we can expect the following.
By adding a configuration that determines the agent's behavior policy when the network connection is lost, user can determine which policy to use through the configuration.
The text was updated successfully, but these errors were encountered: