From a033d3d065124d9edaa292ab5b56f46e28add876 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Tue, 16 Aug 2011 14:15:48 -0700 Subject: [PATCH] * usr/lib/byobu/custom, usr/lib/byobu/disk_io, usr/lib/byobu/ec2_cost, usr/lib/byobu/network, usr/lib/byobu/reboot_required, usr/lib/byobu/updates_available: - must separate run dirs for tmux/screen run status scripts; otherwise, calculated rates are off --- debian/changelog | 5 +++++ usr/lib/byobu/custom | 2 +- usr/lib/byobu/disk_io | 2 +- usr/lib/byobu/ec2_cost | 2 +- usr/lib/byobu/network | 2 +- usr/lib/byobu/reboot_required | 2 +- usr/lib/byobu/updates_available | 2 +- 7 files changed, 11 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 23852493..79419d9a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -53,6 +53,11 @@ byobu (4.30) unreleased; urgency=low rather than a file stat * usr/share/byobu/profiles/tmux: - ensure that byobu-janitor runs on reload + * usr/lib/byobu/custom, usr/lib/byobu/disk_io, usr/lib/byobu/ec2_cost, + usr/lib/byobu/network, usr/lib/byobu/reboot_required, + usr/lib/byobu/updates_available: + - must separate run dirs for tmux/screen run status scripts; + otherwise, calculated rates are off -- Dustin Kirkland Thu, 11 Aug 2011 10:31:31 -0500 diff --git a/usr/lib/byobu/custom b/usr/lib/byobu/custom index 77356af6..ba71c247 100755 --- a/usr/lib/byobu/custom +++ b/usr/lib/byobu/custom @@ -24,7 +24,7 @@ __custom_detail() { } __custom() { - local cache="$BYOBU_RUN_DIR/custom" + local cache="$BYOBU_RUN_DIR/cache.$BYOBU_BACKEND/custom" local i= output= for i in "$BYOBU_CONFIG_DIR/bin/"[0-9]*_*; do # Loop over custom scripts diff --git a/usr/lib/byobu/disk_io b/usr/lib/byobu/disk_io index 84addacf..b9192b22 100755 --- a/usr/lib/byobu/disk_io +++ b/usr/lib/byobu/disk_io @@ -54,7 +54,7 @@ __disk_io() { local disk=${_RET} local t2=`date +%s` t1= for i in "read" "write"; do - local cache="$BYOBU_RUN_DIR/disk.$i" + local cache="$BYOBU_RUN_DIR/cache.$BYOBU_BACKEND/disk.$i" t1=`stat -c %Y "$cache"` 2>/dev/null || t1=0 local unit="kB/s" local rate= x1= x2= symbol= unit= diff --git a/usr/lib/byobu/ec2_cost b/usr/lib/byobu/ec2_cost index 532642e7..74cfe6a8 100755 --- a/usr/lib/byobu/ec2_cost +++ b/usr/lib/byobu/ec2_cost @@ -39,7 +39,7 @@ __ec2_cost() { . "$BYOBU_PREFIX/share/$PKG/ec2/rates.${zone%?}" type=$(wget -q -O - http://169.254.169.254/latest/meta-data/instance-type | $SED -e "s/\./_/g") eval rate="\$$type" - file_to_stat="$BYOBU_RUN_DIR/ec2_cost.instance_type" + file_to_stat="$BYOBU_RUN_DIR/cache.$BYOBU_BACKEND/ec2_cost.instance_type" [ -f "$file_to_stat" ] || wget -q -O "$file_to_stat" http://169.254.169.254/latest/meta-data/instance-type else . "$BYOBU_PREFIX/share/$PKG/ec2/rates."* diff --git a/usr/lib/byobu/network b/usr/lib/byobu/network index 7253690f..0cdf0ead 100755 --- a/usr/lib/byobu/network +++ b/usr/lib/byobu/network @@ -39,7 +39,7 @@ __network() { up) symbol="$ICON_UP" ;; down) symbol="$ICON_DN" ;; esac - cache="$BYOBU_RUN_DIR/network.$i" + cache="$BYOBU_RUN_DIR/cache.$BYOBU_BACKEND/network.$i" [ -r "$cache" ] && read x1 < "$cache" || tx1=0 IFS="$OIFS:" while read iface rbytes rpackets rerrs rdrop rfifo rframe rcompressed rmulticast tbytes tpackets terrs tdrop tfifo tcolls tcarrier tcompressed; do diff --git a/usr/lib/byobu/reboot_required b/usr/lib/byobu/reboot_required index 4faf3b70..6664b00f 100755 --- a/usr/lib/byobu/reboot_required +++ b/usr/lib/byobu/reboot_required @@ -20,7 +20,7 @@ # along with this program. If not, see . REBOOT_FLAG="/var/run/reboot-required" -RELOAD_FLAG="$BYOBU_RUN_DIR/reload-required" +RELOAD_FLAG="$BYOBU_RUN_DIR/cache.$BYOBU_BACKEND/reload-required" __reboot_required_detail() { [ -e "$REBOOT_FLAG" ] && ls -alF "$REBOOT_FLAG" 2>&1 diff --git a/usr/lib/byobu/updates_available b/usr/lib/byobu/updates_available index 135cb67d..7aee3f76 100755 --- a/usr/lib/byobu/updates_available +++ b/usr/lib/byobu/updates_available @@ -102,7 +102,7 @@ __updates_available_detail() { } __updates_available() { - local mycache="$BYOBU_RUN_DIR/updates-available" + local mycache="$BYOBU_RUN_DIR/cache.$BYOBU_BACKEND/updates-available" # If mycache is present, use it [ -r $mycache ] && ___print_updates `$SED -n '/[^0-9]/s/ .*$//p' $mycache` # If we really need to do so (mycache doesn't exist, or the package database has changed),