new host related fixes
authorIan Kelling <ian@iankelling.org>
Mon, 16 Feb 2026 07:17:38 +0000 (02:17 -0500)
committerIan Kelling <ian@iankelling.org>
Mon, 16 Feb 2026 07:17:38 +0000 (02:17 -0500)
brc2
brc3
distro-end
filesystem/usr/local/bin/btrbk-run
mail-setup
system-status

diff --git a/brc2 b/brc2
index c37bcd952542f0eddd207fd0b1b63a836e613fe0..2b90ce3cecc7dcc9b0b2b8e3919192fecf2712ab 100644 (file)
--- a/brc2
+++ b/brc2
@@ -356,6 +356,37 @@ EOF
 }
 
 
+# Removes leftover schroot sessions, including bind mounts. dunno yet why
+# this happens. Based on
+# http://logan.tw/posts/2018/02/24/manage-chroot-environments-with-schroot/#list-all-schroot-sessions
+schroot-cleanup() {
+  local session sessions
+  sessions=$(schroot -l --all-sessions | sed 's/session://')
+  for session in $sessions; do
+    schroot -e -c $session
+  done
+}
+
+# usage: $0 SCHROOT_NAME_TO_RM
+schroot-rm() {
+  local conf dir n="$1"
+  conf="/etc/schroot/chroot.d/$n.conf"
+  schroot-cleanup
+  if [[ -s $conf ]]; then
+    dir=$(grep ^directory= "$conf" | sed 's/^directory=//' | head -n1)
+    m s rm -f "$conf"
+  else
+    dir="/nocow/schroot/$n"
+  fi
+  if [[ $dir == /?* && -d $dir ]]; then m s rm -rf "$dir"; fi
+}
+
+crypttab-open() {
+  for f in $(awk '{print $1}' /etc/crypttab | grep -v '#'); do
+    m cryptdisks_start $f
+  done
+  }
+
 # note: this is incomplete and untested.
 # https://wiki.archlinux.org/index.php/Install_Arch_Linux_from_existing_Linux#Creating_a_chroot
 mkarchchroot() {
diff --git a/brc3 b/brc3
index d6ba3c6778bc07c148b29def5fa277e97f82ed18..f492dac32a2ecc99bf8b7d2bb4fd5ef6a6bbe151 100644 (file)
--- a/brc3
+++ b/brc3
@@ -110,18 +110,6 @@ ecne-basefile() {
   echo "WARNING: remove leftover /t/mmchroot"
 }
 
-# cleans up bind mounts that got leftover by an schroot. dunno yet why
-# this happens. Based on
-# http://logan.tw/posts/2018/02/24/manage-chroot-environments-with-schroot/#list-all-schroot-sessions
-
-schroot-cleanup() {
-  local session sessions
-  sessions=$(schroot -l --all-sessions | sed 's/session://')
-  for session in $sessions; do
-    schroot -e -c $session
-  done
-}
-
 # misc bash tip. If we have a set of lines we want to know if one is a specific string, we can use =~ with:
 # regex="("$'\n'"|^)$string("$'\n'"|$)"
 
index 3390e0fdb8a82ecb2a0922b224ce4283c803c6ae..6ebed620264a14de70860d722f73e3717fd81294 100755 (executable)
@@ -1311,14 +1311,14 @@ sgo schrootupdate.timer
 # for testing firefox specific issues
 case $distro in
   trisquel|ubuntu)
-    bookworm
+    name=bookworm
     m mkschroot -s /a/bin/fai/fai/config/files/etc/apt/sources.list.d/bookworm.list/BOOKWORM_FREE \
-      bookworm bookworm chromium fonts-noto-color-emoji fonts-recommended locales
-    sd /nocow/schroot/$schroot_name/etc/locale.gen <<'EOF'
+      $name $name chromium fonts-noto-color-emoji fonts-recommended locales
+    sd /nocow/schroot/$name/etc/locale.gen <<'EOF'
 en_US.UTF-8 UTF-8
 EOF
-    s schroot -c $schroot_name locale-gen
-    s schroot -c $schroot_name update-locale LANG=en_US.UTF-8
+    s schroot -c $name locale-gen
+    s schroot -c $name update-locale LANG=en_US.UTF-8
 
     ;;
   debian)
@@ -1496,10 +1496,10 @@ EOF
     fi
   fi
 }
-tr-config-daemon
 
 case $HOSTNAME in
   $d_host)
+    tr-config-daemon
     sgo transmission-daemon-nn
     ;;
 esac
@@ -1729,6 +1729,21 @@ rm -fv /home/iank/.mpv/watch_later
 rm -rf /home/iank/.mpv
 
 
+# run appimages without manually extracting.
+# https://github.com/AppImage/AppImageKit/wiki/FUSE
+case $(debian-codename) in
+  aramo)
+    pi libfuse2
+    ;;
+  # assume this is newer than aramo
+  *)
+    pi libfuse2t64
+    ;;
+esac
+
+##### begin beets #####
+
+
 ## note: begin u24 message upon pip install
 # If you wish to install a non-Debian-packaged Python package,
 # create a virtual environment using python3 -m venv path/to/venv.
@@ -1743,10 +1758,6 @@ rm -rf /home/iank/.mpv
 ## end
 ## in ubuntu, you can install python3-venv
 
-
-# if [[ ! -e ~/.local/bin/pip ]]; then
-#   tmp=$(mktemp)
-#   wget -O$tmp https://bootstrap.pypa.io/get-pip.py
 #   ### begin msg from below without
 #   #   error: externally-managed-environment
 
@@ -1774,8 +1785,11 @@ rm -rf /home/iank/.mpv
 #   # tried using --break-system-packages, but then trying to use pipx
 #   # failed with something like: no module ensurepath, and again
 #   # complained that I should install system packages, but this time
-#   # there was no alternative. So, fuck it, just getting the system
-#   # package from ubuntu for now.
+#   # there was no alternative. bleh
+# if [[ ! -e ~/.local/bin/pip ]]; then
+#   tmp=$(mktemp)
+#   wget -O$tmp https://bootstrap.pypa.io/get-pip.py
+
 #   python3 $tmp --user
 #   hash -r
 #   python3 -m pip install --user pipx --break-system-packages
@@ -1783,76 +1797,23 @@ rm -rf /home/iank/.mpv
 #   # Upgrade pipx with python3 -m pip install --user --upgrade pipx
 # fi
 
-pi pipx
-
-# run appimages without manually extracting.
-# https://github.com/AppImage/AppImageKit/wiki/FUSE
-case $(debian-codename) in
-  aramo)
-    pi libfuse2
-    ;;
-  # assume this is newer than aramo
-  *)
-    pi libfuse2t64
-    ;;
-esac
-
 
-##### begin beets #####
-
-# ## apt install method, disabled because it is 2025 & packaged version is 2021.
-# # apt install beets fails due to wanting a pip package,
-# # we find out why it wants this through
-# # apt-cache depends --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances beets | less
-# # python-mediafile requires tox, which requires virtualenv, which requires pip.
-# # but, python-mediafile doesn't really require tox, it is specified in
-# # ./usr/lib/python3/dist-packages/mediafile-0.9.0.dist-info/METADATA
-# # as being required only for testing, but the debian package
-# # included it anyways, due to a mistake or bad tooling or something.
-# # I don't plan to use tox, so, according to https://serverfault.com/a/251091,
-# # we can create and install a dummy package by:
-# #
-# # "equivs-control <name>, edit the file produced to provide the right
-# # dependency and have a nice name, then run equivs-build <name> and
-# # finally dpkg -i the resulting .deb file"
-# # as of 2023-02, the tox dependency was removed in debian unstable, so
-# # this hack will probably go away in t12.
-
-# case $(debian-codename) in
-#   aramo)
-#     if pcheck tox; then
-#       tmpdir="$(mktemp -d)"
-#       cd "$tmpdir"
-#       # edited from output of equivs-control tox
-#       cat >tox <<'EOF'
-# Section: python
-# Priority: optional
-# Standards-Version: 3.9.2
-# Package: tox
-# Description: tox-dummy
-# EOF
-#       equivs-build tox
-#       sudo dpkg -i tox_1.0_all.deb
-#       rm -rf ./tox*
-#       cd
-#       rm -r "$tmpdir"
-#     fi
-#     ;;
-# esac
-# pi beets beets-doc
-# # get rid of annoying message
-# s sed -ri "s/^([[:space:]]*ui.print_\('Playing)/#\1/" /usr/share/beets/beetsplug/play.py
 
 
-# I ran this initially to make sure things were working, but don't need it again.
-#pipx ensurepath -v
-#
-# in brackets are nondefault plugins
-pipx install 'beets[lyrics,discogs,mbsync]'
+if [[ ! -d ~/.pyenv/.git ]]; then
+  git clone https://github.com/pyenv/pyenv.git ~/.pyenv
+  . /b/ds/brc2
+  mypyenvinit
+  pyenv install 3.13
+  pyenv global 3.13
+  # from pipx install instructions
+  python3 -m pip install --user pipx
+  python3 -m pipx ensurepath
+  # from beets install instructions.
+  # in brackets are nondefault plugins
+  pipx install 'beets[lyrics,discogs,mbsync]'
+fi
 
-# note: when i first setup beets, i found installing some plugins
-# useful, but now it is bundled with enough good ones that i found no
-# urgent need.
 
 ##### end beets #####
 
@@ -2159,7 +2120,7 @@ case $HOSTNAME in
     if [[ ! -e /etc/apt/sources.list.d/pgdg.sources ]]; then
       pi postgresql-common
       sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y noble
-      pi postgresql-18
+      pi postgresql-17
       sudo -u postgres createuser -d iank
       sudo usermod -a -G postgres iank
     fi
index 65fd56af259694f651c91ebb8997572673c34852..f2341fcafecb9f5cf33a750743042cf305479bb6 100755 (executable)
@@ -685,6 +685,9 @@ if [[ ! -v targets && ! $source ]]; then
     if [[ $HOSTNAME != frodo ]]; then
       targets+=(frodo.b8.nz)
     fi
+    if [[ $HOSTNAME != kd ]]; then
+      targets+=(kd.b8.nz)
+    fi
     wireless_home_hosts=(
       sy
       so
@@ -940,7 +943,7 @@ df --output=size,pcent / | tail -n1"
     fi
 
     # we may be booted into a bootstrap fs or something
-    min_root_kb=$(( 1024 * 1024 * 200 )) # 200 gb
+    min_root_kb=$(( 1024 * 1024 * 70 )) # 70 gb
     tmp=$(( root_size < min_root_kb ))
     if (( tmp )); then
       e "warning: $h: root_size=$root_size < 200gb, perhaps it is booted to bootstrap vol. skipping for now"
index fb1548dc305926da6a3cf6bf31b08ea97dc131f1..4eb119ef3e5c8080aef651f5d782b869be00d9d8 100755 (executable)
@@ -4830,7 +4830,7 @@ fi
 # optimization, this only needs to be run once
 if [[ ! -e /var/lib/prometheus/node-exporter/exim_paniclog.prom ]]; then
   sysd-prom-fail-install epanicclean
-  sre epanicclean
+  son epanicclean
 fi
 
 case $HOSTNAME in
index ce733ab6159a9fafa2fc2517554bb2d74d1dc029..f99346a517f2712ab7af5297f9b8065ca3287381 100755 (executable)
@@ -97,7 +97,7 @@ write-status() {
   esac
 
   case $HOSTNAME in
-    kd)
+    frodo)
       services=(
         prometheus-node-exporter
         prometheus-alertmanager
@@ -139,10 +139,6 @@ write-status() {
     chars+=(EXIM)
   fi
 
-  if ! pgrep -fc '^/bin/bash /usr/local/bin/prof-tail$' &>/dev/null; then
-    chars+=(PROF)
-  fi
-
   if [[ -e /a/bin/bash_unpublished/source-state ]]; then
     # /a gets remounted due to btrbk, ignore error code for file doesnt exist
     source /a/bin/bash_unpublished/source-state || [[ $? == 1 ]]
@@ -194,6 +190,11 @@ write-status() {
 
   if [[ $MAIL_HOST == "$HOSTNAME" ]]; then
 
+    if ! pgrep -fc '^/bin/bash /usr/local/bin/prof-tail$' &>/dev/null; then
+      chars+=(PROF)
+    fi
+
+
     bouncemsg=
     glob=(/m/md/bounces/new/*)
     if [[ -e ${glob[0]} ]]; then