On Wed, 2011-06-29 at 09:15 -0400, Genes MailLists wrote:
On 06/29/2011 06:01 AM, Bryn M. Reeves wrote:
> print "pid: %s" % pid # add this line
Great idea:
./needs-restarting
pid: 1
Traceback (most recent call last):
File "./needs-restarting", line 138, in <module>
sys.exit(main(sys.argv))
File "./needs-restarting", line 118, in main
for fn in get_open_files(pid):
File "./needs-restarting", line 85, in get_open_files
for line in maps.readlines():
IOError: [Errno 13] Permission denied
From this we see:
$ ls -l /proc/1/smaps
0 -r--r--r--. 1 root root 0 Jun 28 13:25 /proc/1/smaps
$ cat /proc/1/smaps
cat: /proc/1/smaps: Permission denied
So that is the source of the problem - tho it probably should not give up.
But the mode bits allow reading, and on my system "cat /proc/1/smaps"
succeeds (though it's empty). I don't think those files have extended
attributes so that wouldn't be it.
Curiouser and curiouser, as Alice said.
poc