mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-21 22:13:19 -07:00
* usr/bin/byobu-janitor, usr/lib/byobu/include/shutil: LP: #1071287
- ensure that we re-check metadata service availability each time byobu-janitor runs - move metadata_available flag to more ephemeral run dir - drop timeout on metadata check to 5 seconds
This commit is contained in:
parent
9bd95b0b8c
commit
47a1536a47
3 changed files with 10 additions and 2 deletions
5
debian/changelog
vendored
5
debian/changelog
vendored
|
@ -14,6 +14,11 @@ byobu (5.22) unreleased; urgency=low
|
||||||
- use a better variable name for memory usage
|
- use a better variable name for memory usage
|
||||||
* usr/lib/byobu/custom, usr/share/man/man1/byobu.1:
|
* usr/lib/byobu/custom, usr/share/man/man1/byobu.1:
|
||||||
- fix color for custom scripts; default to no color changes
|
- fix color for custom scripts; default to no color changes
|
||||||
|
* usr/bin/byobu-janitor, usr/lib/byobu/include/shutil: LP: #1071287
|
||||||
|
- ensure that we re-check metadata service availability each time
|
||||||
|
byobu-janitor runs
|
||||||
|
- move metadata_available flag to more ephemeral run dir
|
||||||
|
- drop timeout on metadata check to 5 seconds
|
||||||
|
|
||||||
[ Jake Biesinger and Dustin Kirkland ]
|
[ Jake Biesinger and Dustin Kirkland ]
|
||||||
* usr/share/byobu/keybindings/common, usr/share/byobu/keybindings/f-
|
* usr/share/byobu/keybindings/common, usr/share/byobu/keybindings/f-
|
||||||
|
|
|
@ -27,6 +27,9 @@ PKG="byobu"
|
||||||
# Ensure that all updates get run immediately
|
# Ensure that all updates get run immediately
|
||||||
rm -rf "$BYOBU_RUN_DIR/.last.$BYOBU_BACKEND"
|
rm -rf "$BYOBU_RUN_DIR/.last.$BYOBU_BACKEND"
|
||||||
|
|
||||||
|
# Ensure that we re-check metadata service
|
||||||
|
rm -f "$BYOBU_CONFIG_DIR/.metadata_available" "$BYOBU_RUN_DIR/.metadata_available"
|
||||||
|
|
||||||
# Exit immediately, if we're not forced, and there is no reload flag
|
# Exit immediately, if we're not forced, and there is no reload flag
|
||||||
FLAG="$BYOBU_RUN_DIR/reload-required"
|
FLAG="$BYOBU_RUN_DIR/reload-required"
|
||||||
if [ "$1" != "--force" ] && [ ! -e "$FLAG" ]; then
|
if [ "$1" != "--force" ] && [ ! -e "$FLAG" ]; then
|
||||||
|
|
|
@ -209,7 +209,7 @@ metadata_available() {
|
||||||
# This is really ugly. We need a reliable, fast way of determining
|
# This is really ugly. We need a reliable, fast way of determining
|
||||||
# if a metadata service is available, that does NOT slow down non-ec2
|
# if a metadata service is available, that does NOT slow down non-ec2
|
||||||
# machines.
|
# machines.
|
||||||
local x=0 cache="$BYOBU_CONFIG_DIR/.metadata_available"
|
local x=0 cache="$BYOBU_RUN_DIR/.metadata_available"
|
||||||
# First, check the cache
|
# First, check the cache
|
||||||
if [ -s "$cache" ]; then
|
if [ -s "$cache" ]; then
|
||||||
# Metadata is non-empty, so we have metadata available
|
# Metadata is non-empty, so we have metadata available
|
||||||
|
@ -218,7 +218,7 @@ metadata_available() {
|
||||||
# Must seed the cache
|
# Must seed the cache
|
||||||
if [ -e /etc/ec2_version ] || [ -e /usr/sbin/update-grub-legacy-ec2 ]; then
|
if [ -e /etc/ec2_version ] || [ -e /usr/sbin/update-grub-legacy-ec2 ]; then
|
||||||
# This *looks* like a machine with metadata, so background a potentially slow check
|
# This *looks* like a machine with metadata, so background a potentially slow check
|
||||||
wget -q -O "$cache" --timeout=10 --tries=1 http://169.254.169.254 2>/dev/null &
|
wget -q -O "$cache" --timeout=5 --tries=1 http://169.254.169.254 2>/dev/null &
|
||||||
sleep 0.02
|
sleep 0.02
|
||||||
[ -s "$cache" ] && x=1
|
[ -s "$cache" ] && x=1
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue