Skip to content

Commit

Permalink
Avoid thousands of lsof warnings in chroot
Browse files Browse the repository at this point in the history
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."
  • Loading branch information
henrich committed Sep 2, 2021
1 parent e100693 commit 60f8606
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion 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

0 comments on commit 60f8606

Please sign in to comment.