Closed GoogleCodeExporter closed 8 years ago
If you run this script as end user and as root what are the results?
import psutil
for proc in psutil.process_iter():
try:
print proc
except psutil.AccessDenied:
print "AccessDenied exception for PID %s" % (proc.pid)
except Exception,e:
print "Other exception: %s" % (e)
I suspect this is a legitimate access denied error; OS X has very stringent
security restrictions. I believe in 10.7 the security management prevents you
from reading information from another process, even when the querying process
is run by the same user ID as the process you're trying to read info for.
Original comment by jlo...@gmail.com
on 15 Sep 2011 at 3:49
But the problem is that it does not only happen with 10.7, but also with 10.5
and 10.6 and previous versions of psutil worked fine with 10.5 and 10.6.
Original comment by fdv...@gmail.com
on 15 Sep 2011 at 3:59
I ran the script on 10.6.8 and it works as I would expect, using the current
SVN version of psutil. If you run it as root you should see information for all
the processes.
Original comment by jlo...@gmail.com
on 15 Sep 2011 at 4:36
I continue getting only the pid of the processes. I used "sudo su".
Does the script work as expected if you replace "print proc" with "print
proc.name"? I get a lot of AccessDenied exceptions.
Original comment by fdv...@gmail.com
on 16 Sep 2011 at 8:30
"sudo su" does not make any sense.. do you mean you used sudo to run the
script? It should be run like the below example, taken from my system.
[user@host ]$ sudo python osx_process_iter.py
Password:
psutil.Process(pid=66608, name='Python')
psutil.Process(pid=4628, name='AppleSpell')
psutil.Process(pid=4008, name='DashboardClient')
psutil.Process(pid=3963, name='pboard')
psutil.Process(pid=3960, name='fontd')
psutil.Process(pid=3958, name='Finder')
psutil.Process(pid=3957, name='SystemUIServer')
psutil.Process(pid=3956, name='Dock')
psutil.Process(pid=3939, name='WindowServer')
psutil.Process(pid=3938, name='loginwindow')
psutil.Process(pid=1659, name='dbus-daemon')
[...]
Original comment by jlo...@gmail.com
on 16 Sep 2011 at 11:55
Original comment by jlo...@gmail.com
on 18 Sep 2011 at 6:54
I'm going to close this one as invalid for inactivity for now.
If you still think this is a bug in psutil just reply and I'll reopen.
Original comment by g.rodola
on 22 Oct 2011 at 11:24
Original issue reported on code.google.com by
fdv...@gmail.com
on 15 Sep 2011 at 3:33