From: Ian Kelling Date: Thu, 20 Nov 2025 11:53:16 +0000 (-0500) Subject: minor fixes X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=2a13ccaedd8b32d0578a21a2364131072de0758c;p=distro-setup minor fixes --- diff --git a/brc2 b/brc2 index 4be5d67..06490fc 100644 --- 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 diff --git a/distro-end b/distro-end index 2056d10..c0dbfdd 100755 --- a/distro-end +++ b/distro-end @@ -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 diff --git a/filesystem/usr/local/bin/joins-namespace-of-check b/filesystem/usr/local/bin/joins-namespace-of-check index 625d92f..6949004 100755 --- a/filesystem/usr/local/bin/joins-namespace-of-check +++ b/filesystem/usr/local/bin/joins-namespace-of-check @@ -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) diff --git a/system-status b/system-status index 70de43c..b9f2fe5 100755 --- a/system-status +++ b/system-status @@ -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