-
Notifications
You must be signed in to change notification settings - Fork 687
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try harder to attach to an existing tmux session
If in the course of an ssh/tmux session the tmux package is upgraded and the ssh connection broken, the next ssh attempt will encounter an error because of the tmux protocol version mismatch. The old tmux can be used to reattach by searching for the tmux process under /proc and using its reference to the old tmux executable. This change attempts to do that automatically if a first "tmux attach" attempt fails, but we can see that a previous session still exists.
- Loading branch information
Showing
7 changed files
with
34 additions
and
32 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
9 changes: 0 additions & 9 deletions
9
install_files/ansible-base/roles/common/files/bashrc_securedrop_additions
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ Priority: optional | |
Maintainer: SecureDrop Team <[email protected]> | ||
Homepage: https://securedrop.org | ||
Package: securedrop-config | ||
Version: 0.1.2+0.13.0~rc1 | ||
Version: 0.1.3+0.13.0~rc1 | ||
Architecture: all | ||
Description: Establishes baseline system state for running SecureDrop. | ||
Configures apt repositories. |
17 changes: 17 additions & 0 deletions
17
install_files/securedrop-config/etc/profile.d/securedrop_additions.sh
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[[ $- != *i* ]] && return | ||
|
||
which tmux >/dev/null 2>&1 || return | ||
|
||
function tmux_attach_via_proc() { | ||
pid=$(pgrep --newest tmux) | ||
if test -n "$pid" | ||
then | ||
/proc/$pid/exe attach | ||
fi | ||
return 1 | ||
} | ||
|
||
if test -z "$TMUX" | ||
then | ||
(tmux attach || tmux_attach_via_proc || tmux new-session) | ||
fi |
This file contains 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