mostly fixes
authorIan Kelling <ian@iankelling.org>
Wed, 21 Jul 2021 22:06:46 +0000 (18:06 -0400)
committerIan Kelling <ian@iankelling.org>
Wed, 21 Jul 2021 22:06:46 +0000 (18:06 -0400)
btrbk-run
check-subvol-stale
distro-begin
distro-end
filesystem/etc/apt/apt.conf.d/02proxy
mail-setup
mailtest-check
mount-latest-remote
mount-latest-subvol
subdir_files/sieve/liststest.sieve

index 88676beb36318e83f8835a6d72ed48c6e1f118ad..fe9ffcec6f696fa20a8767f9088cc5e0eabb33c3 100644 (file)
--- a/btrbk-run
+++ b/btrbk-run
@@ -142,14 +142,14 @@ if $verbose; then
 fi
 ### end options parsing
 
-# note, this test succeeds if not installed
+# remove path from earlier version of btrbk
+rm -f /usr/sbin/btrbk
+# note, this still works as intended if there is no /usr/bin/btrbk
 if [[ /a/opt/btrbk/btrbk -nt /usr/bin/btrbk ]]; then
   if [[ -e /b/distro-functions/src/package-manager-abstractions ]]; then
     . /b/distro-functions/src/package-manager-abstractions
     pi asciidoctor
   fi
-  # remove path from earlier version of btrbk
-  rm -f /usr/sbin/btrbk
   cd /a/opt/btrbk
   m make
   m sudo make install
@@ -183,8 +183,8 @@ if [[ ! -v targets && ! $source ]]; then
       fi
       ;;&
     kw|x2|x3|sy)
-      if $at_work && ping -q -c1 -w1 iank.vpn2.office.fsf.org &>/dev/null; then
-        home=iank.vpn2.office.fsf.org
+      if $at_work && ping -q -c1 -w1 iank.vpn.office.fsf.org &>/dev/null; then
+        home=iank.vpn.office.fsf.org
       else
         home=b8.nz
       fi
index d20c1aaeb848cb85553a5ff82a72326d140ab54b..3d649886c39bbe283d9cd17446793a5130fd19ac 100644 (file)
@@ -16,8 +16,7 @@
 
 [[ $EUID == 0 ]] || exec sudo -E "${BASH_SOURCE[0]}" "$@"
 
-set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?. PIPESTATUS: ${PIPESTATUS[@]}" >&2' ERR
+source /usr/local/lib/err
 
 shopt -s nullglob
 
@@ -83,6 +82,20 @@ d() {
   fi
 }
 
+# duplicated in mount-latest-sub
+mapper-dev() {
+  local mapdev
+  local -n devref=$1
+  if [[ $devref == /dev/dm-* ]]; then
+    for mapdev in /dev/mapper/*; do
+      if [[ $(readlink -f $mapdev) == "$devref" ]]; then
+        devref=$mapdev
+        break
+      fi
+    done
+  fi
+}
+
 for d; do
   if $subvol_path; then
     svp=$d
@@ -105,7 +118,12 @@ for d; do
     ### this is duplicated in mount-latest-subvol
     # note, we need $dev because $d might not be mounted, and we do this loop
     # because the device in fstab for the rootfs can be different.
-    for devx in $(btrfs fil show $dev| sed -rn 's#.*path (/\S+)$#\1#p'); do
+    for devx in $(btrfs fil show $dev| sed -rn 's#.*path (\S+)$#\1#p'); do
+      if [[ $devx == dm-* ]]; then
+        devx=/dev/$devx
+        d mapper-dev $devx
+        mapper-dev devx
+      fi
       d devx=$devx
       root_dir=$(sed -rn "s,^\s*$devx\s+(\S+).*\bsubvolid=[05]\b.*,\1,p" /etc/mtab /etc/fstab|head -n1)
       if [[ $root_dir ]]; then
index 0e0af0f4cbd37ec7ca0a97708ab2b7965f68e077..e84c883d83162feea76f75148756439bbf467cb2 100755 (executable)
@@ -351,7 +351,7 @@ fi
 if isdeb && [[ $(debian-codename) == nabia ]]; then
   sudo dd of=/etc/apt/preferences.d/nabia-focal-missing <<'EOF'
 Explanation: libilmbase* are needed for emacs
-Package: libilmbase-dev libilmbase24 unrar-free pidgin pidgin-* libpurple0 p7zip mumble lightdm mate-desktop-environment mate-menus mate-panel mate-session-manager ubuntu-mate-default-settings mate-control-center mate-control-center-common lightdm-gtk-greeter firefox libfdk-aac1
+Package: libilmbase-dev libilmbase24 unrar-free pidgin pidgin-* libpurple0 p7zip mumble lightdm liblightdm-gobject-1-0 mate-desktop-environment mate-desktop-environment-* mate-panel mate-panel-* libmate-* mate-menus gir1.2-matemenu-2.0 mate-session-manager ubuntu-mate-default-settings mate-control-center mate-control-center-common lightdm-gtk-greeter firefox libfdk-aac1 mate-media mate-media-common
 Pin: release n=focal,o=Ubuntu
 Pin-Priority: 500
 EOF
index b1de65474e898e85b69ae3c20cf30c2220e274a4..66d67582566350169de774b7bd5fc5f520fe5e3e 100755 (executable)
@@ -84,6 +84,8 @@ pi ${p2[@]}
 
 conflink
 
+sudo rm -fv
+
 # no equivalent in other distros:
 if isdeb && pcheck apt-file; then
   # this condition is just a speed optimization
@@ -148,13 +150,11 @@ pi debootstrap
 ######### begin universal pinned packages ######
 case $(debian-codename) in
   nabia|etiona|flidas)
-    sd /etc/apt/preferences.d/etiona-buster <<EOF
+    sudo rm -fv /etc/apt/preferences.d/etiona-buster
+    sd /etc/apt/preferences.d/trisquel-debian <<EOF
+Explanation: Debian* includes Debian + Debian Backports
 Package: *
-Pin: release n=buster
-Pin-Priority: -100
-
-Package: *
-Pin: release n=buster-updates
+Pin: release o=Debian*
 Pin-Priority: -100
 EOF
     ;;&
@@ -345,6 +345,9 @@ deb-src http://security.debian.org/ buster/updates main
 
 deb http://http.us.debian.org/debian buster-updates main
 deb-src http://http.us.debian.org/debian buster-updates main
+
+deb http://http.debian.net/debian buster-backports main
+deb-src http://http.debian.net/debian buster-backports main
 EOF
     if ! diff -q $t $f; then
       curl -s https://ftp-master.debian.org/keys/archive-key-10-security.asc | sudo apt-key add -
@@ -451,6 +454,20 @@ EOF
     ;;
 esac
 
+
+
+case $codename_compat in
+  focal)
+    sd /etc/apt/preferences.d/nabia-btrfs-progs <<'EOF'
+Package: btrfs-progs
+Pin: release a=buster-backports
+Pin-Priority: 500
+EOF
+    p install btrfs-progs
+  ;;
+esac
+
+
 # 2020-03-03 old file
 s rm -fv /etc/apt/preferences.d/radicale
 ######### end universal pinned packages ######
@@ -870,6 +887,13 @@ case $codename_compat in
     ;;
 esac
 
+case $codename_compat in
+  focal)
+    pi libext2fs-dev libzstd-dev
+    cd /a/opt/btrfs-progs
+    ;;
+esac
+
 
 case $codename_compat in
   bionic)
@@ -1315,6 +1339,8 @@ case $HOSTNAME in
     ;;
 esac
 
+mkdir -p $tdir
+
 # adapted from /var/lib/dpkg/info/transmission-daemon.postinst
 # 450 seems likely to be unused. we need to specify one or else
 # it won't be stable across installs.
index 8cd8970d777548ac1b7801b15068d1a879d72675..bc8df27fae0ae2d5c34c68f39865020bead6542b 100644 (file)
@@ -2,7 +2,40 @@
 # This overrides the hardcoded proxy setting done by fai.
 # Figured I'd leave it as post install so I could adjust the
 # detect script easier.
-Acquire::http::Proxy-Auto-Detect "/etc/apt/detect-http-proxy";
+
+# 2021, this has been failing randomly and my attempts at debugging
+# have lead no where. eg:
+
+
+# Err:1 http://http.us.debian.org/debian buster InRelease
+#   500  Connection failure: Address family not supported by protocol [IP: 192.168.0.130 3142]
+# Err:2 http://http.us.debian.org/debian buster-updates InRelease
+#   500  Connection failure: Address family not supported by protocol [IP: 192.168.0.130 3142]
+# Hit:3 http://archive.trisquel.info/trisquel nabia-security InRelease
+# Hit:4 http://mirror.fsf.org/trisquel nabia InRelease
+# Hit:5 http://mirror.fsf.org/trisquel nabia-updates InRelease
+# Get:6 http://security.debian.org buster/updates InRelease [65.4 kB]
+# Hit:7 http://mirror.fsf.org/trisquel nabia-backports InRelease
+# Get:8 http://http.debian.net/debian buster-backports InRelease [46.7 kB]
+# Hit:9 http://archive.ubuntu.com/ubuntu focal InRelease
+# Get:10 http://archive.ubuntu.com/ubuntu focal-security InRelease [114 kB]
+# Hit:11 http://ppa.launchpad.net/obsproject/obs-studio/ubuntu focal InRelease
+# Get:12 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
+# Get:13 http://archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
+# Get:14 http://security.debian.org buster/updates/main Sources [188 kB]
+# Get:15 http://security.debian.org buster/updates/main amd64 Packages [293 kB]
+# Get:16 http://http.debian.net/debian buster-backports/main Sources [475 kB]
+# Get:17 http://http.debian.net/debian buster-backports/main amd64 Packages [486 kB]
+# Get:18 http://http.debian.net/debian buster-backports/main Translation-en [409 kB]
+# Get:19 http://http.debian.net/debian buster-backports/main amd64 Contents (deb) [7,151 kB]
+# Get:20 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [1,086 kB]
+# Get:21 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [841 kB]
+# Fetched 11.4 MB in 5s (2,235 kB/s)
+# Reading package lists... Done
+# W: Failed to fetch http://http.us.debian.org/debian/dists/buster/InRelease  500  Connection failure: Address family not supported by protocol [IP: 192.168.0.130 3142]
+# W: Failed to fetch http://http.us.debian.org/debian/dists/buster-updates/InRelease  500  Connection failure: Address family not supported by protocol [IP: 192.168.0.130 3142]
+
+#Acquire::http::Proxy-Auto-Detect "/etc/apt/detect-http-proxy";
 
 # misc settings not worth making another settings file
 APT::AutoRemove::SuggestsImportant "false";
index a42040748c62080aa1c5d40cd6ab19c951ec6fd5..37bc9d9f604af3d07785a2663c3b25db54adacd4 100755 (executable)
@@ -343,6 +343,10 @@ forward=$u@$mxhost
 smarthost="$mxhost::$mxport"
 uhome=$(eval echo ~$u)
 
+# Somehow on one machine, a file got written with 664 perms.
+# just being defensive here.
+umask 0022
+
 source /a/bin/bash_unpublished/source-state
 if [[ ! $MAIL_HOST ]]; then
   err "\$MAIL_HOST not set"
@@ -740,6 +744,10 @@ awk 'BEGIN { FS = ":" } ; $6 !~ /^\/home/ { print $1 }' /etc/passwd| while read
   fi
 done
 
+if ! grep -q "^ncsoft:" /etc/aliases; then
+  echo "ncsoft: graceq2323@gmail.com" |m tee -a /etc/aliases
+fi
+
 
 
 m gpasswd -a iank adm #needed for reading logs
@@ -818,6 +826,10 @@ m sed -i --follow-symlinks -f - /etc/aliases <<EOF
 /^root:/d
 EOF
 
+cat >/etc/exim4/conf.d/rewrite/34_iank_rewriting <<'EOF'
+ncsoft@zroe.org graceq2323@gmail.com hE
+EOF
+
 rm -vf /etc/exim4/conf.d/main/000_localmacros # old filename
 cat >/etc/exim4/conf.d/main/000_local <<EOF
 MAIN_TLS_ENABLE = true
index 3c36b7cadc72e01c117a3bd81f7b79827c3d6111..a5e2d32a3142a6a9b9be9e4ea8affc4bcf57e580 100755 (executable)
@@ -1,9 +1,6 @@
 #!/bin/bash
 
-if ! test "$BASH_VERSION"; then echo "error: shell is not bash" >&2; exit 1; fi
-shopt -s inherit_errexit 2>/dev/null ||: # ignore fail in bash < 4.4
-set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?. PIPESTATUS: ${PIPESTATUS[*]}" >&2' ERR
+source /b/errhandle/err
 
 [[ $EUID == 0 ]] || exec sudo -E "${BASH_SOURCE[0]}" "$@"
 
index 3e3600992c8aa4fc49ef430efc71ada94f98df15..41fd2fc799f23c0caac13864b90b2782ac7d0067 100755 (executable)
@@ -13,8 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
+source /usr/local/lib/err
 
 script_dir=$(dirname $(readlink -f "$BASH_SOURCE"))
 
index eadb6c05af88280b2f5c1caf2c79703092d38c6d..caa6177807c50a4c914fae2f46372a34f19dad13 100644 (file)
@@ -131,6 +131,21 @@ umount-kill() {
   fi
 }
 
+# duplicated in check-subvol
+mapper-dev() {
+  local mapdev
+  local -n devref=$1
+  if [[ $devref == /dev/dm-* ]]; then
+    for mapdev in /dev/mapper/*; do
+      if [[ $(readlink -f $mapdev) == "$devref" ]]; then
+        devref=$mapdev
+        break
+      fi
+    done
+  fi
+}
+
+
 ##### begin command line parsing ########
 
 # you can remove this if you do not have options which can have args with spaces or empty.
@@ -170,18 +185,6 @@ if [[ -e /mnt/root/root2-fstab ]]; then
   mnt /mnt/boot2
 fi
 
-mapper-dev() {
-  local -n devref=$1
-  if [[ $devref == /dev/dm-* ]]; then
-    for d in /dev/mapper/*; do
-      if [[ $(readlink -f $d) == "$root_dev" ]]; then
-        devref=$d
-        break
-      fi
-    done
-  fi
-}
-
 root_dev=$(awk '$2 == "/" {print $1}' /etc/mtab)
 mapper-dev root_dev
 
@@ -327,9 +330,16 @@ for vol in q a o i; do
 
   ### begin getting root_dir
   ### this is duplicated in check-subvol-stale
+
+  dev=$(sed -rn "s,^\s*([^#]\S*)\s+$d\s.*,\1,p" /etc/fstab /etc/mtab|head -n1)
+  d dev=$dev
   # note, we need $dev because $d might not be mounted, and we do this loop
   # because the device in fstab for the rootfs can be different.
-  for devx in $(btrfs fil show $dev| sed -rn 's#.*path (/\S+)$#\1#p'); do
+  for devx in $(btrfs fil show $dev| sed -rn 's#.*path (\S+)$#\1#p'); do
+    if [[ $devx == dm-* ]]; then
+      devx=/dev/$devx
+      mapper-dev devx
+    fi
     d devx=$devx
     root_dir=$(sed -rn "s,^\s*$devx\s+(\S+).*\bsubvolid=[05]\b.*,\1,p" /etc/mtab /etc/fstab|head -n1)
     if [[ $root_dir ]]; then
index 1fda5cd5bd6456f582bbdcce69a8673c1c66205c..0e443079f85409cf621762cbe3ab96868a45c130 100644 (file)
@@ -32,6 +32,7 @@ if anyof (
 if anyof (
   header :contains "list-id" "<bbdb-info.lists.sourceforge.net>",
   header :contains "list-id" "<bug-bash.gnu.org>",
+  header :contains "list-id" "<h-source-users.nongnu.org>",
   header :contains "list-id" "<bug-gnu-emacs.gnu.org>",
   header :contains "list-id" "<debian-backports.lists.debian.org>",
   header :contains "list-id" "<debian-security-announce.lists.debian.org>",