-
Notifications
You must be signed in to change notification settings - Fork 37
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 bluechi is online tool #964
base: main
Are you sure you want to change the base?
Conversation
76fe8e1
to
61cf050
Compare
@dofmind ######################
# Example 1: Stop service(s) when bluechi-agent loses connection
$ cat /etc/systemd/system/monitor-bluechi-agent.service
[Unit]
Description=Monitor bluechi-agents connection to controller
[Service]
Type=simple
ExecStart=/usr/local/bin/bluechi-is-online agent --initial-wait=5000 --monitor
$ cat /etc/systemd/system/workload.service
[Unit]
Description=Some workload that should stop running when bluechi-agent disconnects
BindsTo=monitor-bluechi-agent.service
After=monitor-bluechi-agent.service
[Service]
...
######################
# Example 2: Start a service when bluechi-agent loses connection
$ cat /etc/systemd/system/handle-bluechi-agent-offline.service
[Unit]
Description=Handle BlueChi Agent going offline and start do-stuff.service
OnFailure=do-stuff.service
[Service]
Type=simple
ExecStart=/usr/local/bin/bluechi-is-online agent --initial-wait=5000 --monitor Not sure yet if BlueChi will provide some general purpose systemd units for it - I don't have an idea how those could look like at the moment. If you have, please let me know. And if have time to test the |
Thanks for this PR. I tested bluechi-is-online on my system with multiple nodes. The basic behavior of bluechi-is-online worked as we expected. However, there are three issues.
If the leader node is changed before the error
|
Thanks for your feedback! @dofmind
I'd suggest using $ cat /etc/systemd/system/monitor-bluechi-agent.service
[Unit]
Description=Monitor bluechi-agents connection to controller
[Service]
Type=simple
ExecStart=/usr/local/bin/bluechi-is-online agent --initial-wait=5000 --monitor
[Install]
UpheldBy=bluechi-agent.service This way the monitoring service gets restarted as long as the
Although I think the behavior of
This sounds like a bug in BlueChi?! This needs more investigation, I think.
|
I couldn't test using UpheldBy= because my systemd versions (246.9 and 250.5) don't support it. I'll try it after I backport the patch to systemd to support UpheldBy=.
Looks good for a new CLI option with a timeout.
That's right, i will create an issue for this. |
7cf143d
to
c4a1f81
Compare
Ah ok, then the [Service]
Type=simple
ExecStartPre=/usr/local/bin/bluechi-is-online agent --initial-wait=5000
ExecStart=/usr/local/bin/bluechi-is-online agent --monitor
Just added the new option I noticed, however, a problem we have with the order of the changed signals for the connection state and the address. Currently, we first emit the change in the connection state, then the change of the address - which should be reversed, in my point of view. I prepared a small PR to fix this: #968
Thank you! |
Signed-off-by: Michael Engel <mengel@redhat.com>
Signed-off-by: Michael Engel <mengel@redhat.com>
c4a1f81
to
c3adec6
Compare
After applying the updated is-online application and the small PR #968, I tested using the
I created an issue about triggering SwitchController DBus method: #966, if this gets resolved I'll finally be able to apply the is-online solution on my system. Thanks. |
Relates to: #962
So far, this PR adds the
bluechi-is-online
CLI tool, a man page and the RPM package to the spec file.