minor fixes
authorIan Kelling <ian@iankelling.org>
Thu, 20 Nov 2025 11:53:16 +0000 (06:53 -0500)
committerIan Kelling <ian@iankelling.org>
Thu, 20 Nov 2025 11:53:16 +0000 (06:53 -0500)
brc2
distro-end
filesystem/usr/local/bin/joins-namespace-of-check
system-status

diff --git a/brc2 b/brc2
index 4be5d67a1c4f76b5ae10cf2eac22ca0c345c4ec1..06490fcfff4c576b39551133d9b48706ab89032c 100644 (file)
--- a/brc2
+++ b/brc2
@@ -303,14 +303,17 @@ mkschroot() {
       repo=http://deb.debian.org/debian/
       ;;
   esac
+  apps=($@)
 
   if ! $force; then
     if schroot -l | grep -xFq chroot:$n || [[ -s /etc/schroot/chroot.d/$n.conf ]]; then
-      echo "$0: $n schroot already exists, skipping"
+      echo "$0: $n schroot already exists, just installing any apps"
+      if (( ${#apps[@]} )); then
+        sudo DEBIAN_FRONTEND=noninteractive schroot -c $n -- apt-get install --allow-unauthenticated -y ${apps[@]}
+      fi
       return 0
     fi
   fi
-  apps=($@)
   if [[ ! $d ]]; then
     d=/nocow/schroot/$n
   fi
@@ -3699,7 +3702,12 @@ servicepid() {
       # 0 or empty.  This file includes the MainPid, so I expect we
       # could just get this in the first place, but i don't know if that
       # is always the case.
-      pid=$(head -n1 $dir/${unit%.service}.service/cgroup.procs)
+      procsf=$dir/${unit%.service}.service/cgroup.procs
+      if [[ -s $procsf ]]; then
+        pid=$(head -n1 $procsf)
+      else
+        pid=
+      fi
       ;;
   esac
   if [[ $pid ]]; then
index 2056d107acda30aefb396c749ed5b378664ab0b5..c0dbfdd6b2ba2356ff4dbf71a6775d640f8f8d2f 100755 (executable)
@@ -1353,7 +1353,7 @@ case $distro in
   trisquel|ubuntu)
     schroot_name=bookworm
     m mkschroot -s /a/bin/fai/fai/config/files/etc/apt/sources.list.d/bookworm.list/BOOKWORM_FREE \
-      debian $schroot_name chromium fonts-noto-color-emoji fonts-recommended locales
+      $schroot_name debian chromium fonts-noto-color-emoji fonts-recommended locales
     sd /nocow/schroot/$schroot_name/etc/locale.gen <<'EOF'
 en_US.UTF-8 UTF-8
 EOF
@@ -1699,6 +1699,9 @@ DEVICESCAN -a -o on -S on -n standby,q $sched \
 
 ########### misc stuff
 
+# i rely on a newer version.
+pu fzf
+
 # group used by ddcutil
 sudo usermod -a -G i2c iank
 
index 625d92ff256ea29f20bf6da23864ccc4d66103e3..69490044ab8f468cc72bb953cd1f971230bd39c7 100755 (executable)
@@ -53,7 +53,15 @@ fi
 sleep 1
 
 unit="$1"
-pid=$(head -n1 "$slice_dir"/$unit.service/cgroup.procs)
+procsf="$slice_dir"/$unit.service/cgroup.procs
+if [[ -s $procsf ]]; then
+  pid=$(head -n1 $procsf)
+else
+  echo "error: no pid in $procsf. is the service running?"
+  exit 1
+fi
+
+pid=$(head -n1 $procsf)
 ns=$(readlink /proc/$pid/ns/net)
 default_ns=$(readlink /proc/1/ns/net)
 
index 70de43cec5f4460c93da0e4ef38e26bb5ca6010f..b9f2fe5c81a3ede785eb48f04642537770df46dd 100755 (executable)
@@ -127,7 +127,12 @@ write-status() {
       if [[ ! -d $dir ]]; then
         dir=/sys/fs/cgroup/systemd/system.slice
       fi;
-      pid=$(head -n1 $dir/${unit%.service}.service/cgroup.procs ||:)
+      procsf=$dir/${unit%.service}.service/cgroup.procs
+      if [[ -s $procsf ]]; then
+        pid=$(head -n1 $procsf)
+      else
+        pid=
+      fi
       ;;
   esac
   if [[ ! $pid ]]; then