mirror of
https://github.com/cockpit-project/cockpit.git
synced 2026-11-03 21:49:50 -09:00
bridge: Exit beiboot when ssh exits
The cockpit.beiboot process shouldn't live on when its `ssh` process exits during the session. Note that we must only do this after the ferny negotiation, as that sends its own (specific) problem codes. Covered by `TestSession.testBasic`.
This commit is contained in:
parent
b1eed72239
commit
cc7720f94a
1 changed files with 5 additions and 0 deletions
|
|
@ -400,6 +400,10 @@ class SshBridge(Router):
|
|||
logger.debug("SshBridge.do_init: %r", message)
|
||||
self.ssh_peer.write_control(message)
|
||||
|
||||
def setup_session(self) -> None:
|
||||
# if ssh dies during the session, go down with it
|
||||
self.ssh_peer.add_done_callback(self.close)
|
||||
|
||||
|
||||
async def run(args) -> None:
|
||||
logger.debug("Hi. How are you today?")
|
||||
|
|
@ -464,6 +468,7 @@ async def run(args) -> None:
|
|||
return
|
||||
|
||||
logger.debug('Startup done. Looping until connection closes.')
|
||||
bridge.setup_session()
|
||||
try:
|
||||
await bridge.communicate()
|
||||
except BrokenPipeError:
|
||||
|
|
|
|||
Loading…
Reference in a new issue