mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-09-11 07:15:54 +03:00
nixos-rebuild: Fix "too long for Unix domain socket" errors due to long
TMPDIR
This commit is contained in:
parent
d6c182f2ae
commit
3dbf54decb
@ -407,6 +407,13 @@ fi
|
||||
|
||||
tmpDir=$(mktemp -t -d nixos-rebuild.XXXXXX)
|
||||
|
||||
if [[ ${#tmpDir} -ge 60 ]]; then
|
||||
# Very long tmp dirs lead to "too long for Unix domain socket"
|
||||
# SSH ControlPath errors. Especially macOS sets long TMPDIR paths.
|
||||
rmdir "$tmpDir"
|
||||
tmpDir=$(TMPDIR= mktemp -t -d nixos-rebuild.XXXXXX)
|
||||
fi
|
||||
|
||||
cleanup() {
|
||||
for ctrl in "$tmpDir"/ssh-*; do
|
||||
ssh -o ControlPath="$ctrl" -O exit dummyhost 2>/dev/null || true
|
||||
|
Loading…
Reference in New Issue
Block a user