You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. compile psutil on solaris 10
2. try to import it in a script running inside a solaris zone
3. profit?
What is the expected output?
it should just work :)
What do you see instead?
Traceback (most recent call last):
File "./monTest.py", line 9, in <module>
import psutil
File "/ifs/prod/home/notch/graphiteClient/psutil/__init__.py", line 101, in <module>
import psutil._pssunos as _psplatform
File "/ifs/prod/home/notch/graphiteClient/psutil/_pssunos.py", line 27, in <module>
BOOT_TIME = _psutil_sunos.get_process_basic_info(0)[3]
OSError: [Errno 2] No such file or directory: '/proc/0/psinfo'
What version of psutil are you using? What Python version?
psutil 1.0.1
python 2.6.4 (solaris default)
On what operating system? Is it 32bit or 64bit version?
64 bit
Please provide any additional information below.
_pssunos.py uses psutil itself to figure out the current boot time so it can
set the BOOT_TIME global. Unfortunately it does it by trying to read /proc/0
which is only available in the global zone.
there's probably an ugly way to use psrinfo(1M) or another way to get the boot
time of the server from inside a zone.
I haven't checked to see if there are any other methods that don't work inside
the zone either, this was the first one I ran across during initialization
I figured out a way around this, by hacking up _pssunos.py to get the PID of
the lowest processID either named "sched" for the global zones or "zsched" for
the zones themselves and using that pid to determine the boot time.
I'm a novice python programmer, so this code is probably ugly and someone will
want to rewrite it, but its working for me so it may well work for you.
Sorry, I kind of forgot about this issue.
Note to self:
http://stackoverflow.com/questions/1661006/getting-the-uptime-of-a-sunos-unix-box-in-seconds-only
I'll try to take a look at this later.
From manch...@gmail.com on September 09, 2013 05:19:44
Original issue: http://code.google.com/p/psutil/issues/detail?id=425
The text was updated successfully, but these errors were encountered: