-
Notifications
You must be signed in to change notification settings - Fork 687
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
Try harder to attach to an existing tmux session #4231
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
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. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[[ $- != *i* ]] && return | ||
|
||
which tmux >/dev/null 2>&1 || return | ||
|
||
tmux_attach_via_proc() { | ||
# If the tmux package is upgraded during the lifetime of a | ||
# session, attaching with the new binary can fail due to different | ||
# protocol versions. This function attaches using the reference to | ||
# the old executable found in the /proc tree of an existing | ||
# session. | ||
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not requesting additional comments in this file because the logic is cleanly presented and the corresponding commit message is top-notch. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That was a good not-request, though. No one should have to go find my top-notch commit message when trying to understand this. 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version bump here is absolutely correct. It requires matching changes in other places, though:
molecule/builder-trusty/tests/vars.yml
)The rationale here is that we want to ensure we're installing exactly a certain version, and also running the package checks on exactly that same version. By default, multiple package versions can pile up in
build/
. We could automatically runrm -rf build/*
to avoid the pile-up, but that seems a bit heavy-handed for the dev env.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
config_version
in vars.yml.