cli: restart bridge tmux session before systemd restart#128
Merged
Conversation
Greptile SummaryEnsures stale detached bridge tmux sessions are cleaned up before systemd restart. This prevents old bridge processes from surviving restarts and continuing to run outdated behavior.
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[sudo baudbot restart] --> B{require_root check}
B -->|not root| C[Exit: requires root]
B -->|is root| D{has_systemd?}
D -->|no| E[Exit: systemd not available]
D -->|yes| F{tmux available?}
F -->|no| K[systemctl restart baudbot]
F -->|yes| G{sudo available?}
G -->|yes| H[sudo -u baudbot_agent tmux kill-session -t slack-bridge]
G -->|no| I{runuser available?}
I -->|yes| J[runuser -u baudbot_agent -- tmux kill-session -t slack-bridge]
I -->|no| K
H --> K
J --> K
K --> L[End]
Last reviewed commit: e176372 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
baudbot restartto explicitly kill theslack-bridgetmux session before restarting the systemd servicesudo -u <agent>when availablerunuser -u <agent>whensudois unavailableTests
bin/baudbot.test.shcoverage asserting restart path:slack-bridgesystemctl restart baudbotbash bin/baudbot.test.shbash -n bin/baudbot