From: Ian Kelling Date: Fri, 9 Oct 2026 10:59:44 +0000 (-0400) Subject: wireguard fixes X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=HEAD;p=distro-setup wireguard fixes --- diff --git a/brc2 b/brc2 index 172e006..3c3ac99 100644 --- a/brc2 +++ b/brc2 @@ -1541,12 +1541,35 @@ apache-strip() { } chro() { + local prtmp pid ret=0 if type -p chromium &>/dev/null; then cmd=chromium else cd / cmd="schroot -c bookworm chromium" - CHROMIUM_FLAGS='--enable-remote-extensions' $cmd -- "$@" & r + fi + # without --no-sandbox, it fails due to not having user namespaces + # enabled. As of 2026, User namespaces has too often been a + # mechanism for giving root rather than being useful as a security + # measure. + echo "iank: running CHROMIUM_FLAGS=--enable-remote-extensions $cmd -- --no-sandbox $*" + CHROMIUM_FLAGS=--enable-remote-extensions $cmd -- --no-sandbox "$@" & + pid=$! + # wait in case it dies right away so that we print the output instead of exiting + sleep 2 + prtmp=$(jobs -s; jobs -r) + if (( ${#prtmp} != 0 )); then + printf '\n\n\n\n\n#################\n\n' + echo "iank: exiting this shell for convenience" + sleep 0.5 + r + else + # background: The pid arg is required to get the exit code. + wait $pid || ret=$? + printf '\n\n\n\n\n#################\n\n' + echo "iank: detected chromium exit with success (perhaps it was already running). exiting this shell for convenience" + sleep 2 + r fi } @@ -2200,6 +2223,7 @@ Description=Initial setup of netns for wg-quick-tr %I [Service] Type=oneshot +ExecStartPre=/p/c/mullvad-wg-config-validate %i ExecStart=/usr/bin/flock -w 20 /tmp/newns.flock /usr/local/bin/newns -n 10.174.$ipsuf start %i ExecStop=/usr/bin/flock -w 20 /tmp/newns.flock /usr/local/bin/newns stop %i RemainAfterExit=yes @@ -2322,12 +2346,13 @@ EOF for host in ${!vpn_ips[@]}; do ipsuf=${vpn_ips[$host]} cat <