From 60f86069c4f70aa177f58ad73073375cc77f86f8 Mon Sep 17 00:00:00 2001 From: Hideki Yamane Date: Fri, 3 Sep 2021 00:07:11 +0900 Subject: [PATCH] Avoid thousands of lsof warnings in chroot Just executing lsof in pbuilder/cowbuilder chroot environment causes flood of warnings. Just -l option avoids this noise. In chroot environment, /etc/passwd is a limited one but /proc has lot of processes that are related to users in the parent environment. -l option means "inhibits the conversion of user ID numbers to login names." --- spec/cases/count_open_pipes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/cases/count_open_pipes.rb b/spec/cases/count_open_pipes.rb index 0245602c..e54d333b 100644 --- a/spec/cases/count_open_pipes.rb +++ b/spec/cases/count_open_pipes.rb @@ -1,5 +1,5 @@ require './spec/cases/helper' -count = ->(*) { `lsof | grep pipe | wc -l`.to_i } +count = ->(*) { `lsof -l | grep pipe | wc -l`.to_i } start = count.() results = Parallel.map(Array.new(20), :in_processes => 20, &count) puts results.max - start