[OmniOS-discuss] LX Zone DTrace
Mini Trader
miniflowtrader at gmail.com
Sun Jan 15 19:21:26 UTC 2017
Here is the strace. Which shows the underlying libc call failing. chdir
would have failed if the directory was not there. Maybe a race condition
going on here? Does this now become a Linux bug?
I've even made a call to pwd in the exception and it does not fail.
lstat("ParameterSet", {st_mode=S_IFDIR|0777, st_size=4, ...}) = 0
chdir("ParameterSet") = 0
write(1, "'/main/documents/oneofmydirectories"...,
101'/main/documents/oneofmydirectories/ParameterSet'
) = 101
getcwd(0x7fffffefebc0, 1026) = -1 ENOENT (No such file or
directory)
write(1, "[Errno 2] No such file or direct"..., 36[Errno 2] No such file or
directory
) = 36
On Sat, Jan 14, 2017 at 10:02 AM, Mini Trader <miniflowtrader at gmail.com>
wrote:
> I just tried on CentOS same error. The directory has to be from LOFS i.e.
> a ZFS pool.
>
> From OmniOS can you output zfs get all zonefileset and /usr/bin/ls -lV
> zonedirectory and share your results.
>
> On Sat, Jan 14, 2017 at 9:35 AM, Natxo Asenjo <natxo.asenjo at gmail.com>
> wrote:
>
>> hi,
>>
>>
>> On Sat, Jan 14, 2017 at 3:16 PM, Mini Trader <miniflowtrader at gmail.com>
>> wrote:
>>
>>> Well the author at my request was able to remove the call to os.getcwd()
>>> which allows the program to operate.
>>>
>>>
>>> If anyone wants to tinker here is an example that will likely break on
>>> someones system. I don't know if this is an LX bug, libc bug, python bug
>>> etc.
>>>
>>> # read a directory, stat all files
>>>
>>> import os
>>> import sys
>>> from stat import *
>>>
>>> def chdir(d):
>>> global cwdlist
>>>
>>> if d != '.':
>>> os.chdir(d)
>>> if d == '..':
>>> cwdlist.pop()
>>> else:
>>> cwdlist.append(d)
>>> print repr('/'.join(cwdlist))
>>> # Comment the line below to allow things to run
>>> os.getcwd()
>>>
>>> def walk(d):
>>> chdir(d)
>>> dirlist = os.listdir('.')
>>> dirlist.sort()
>>> for f in dirlist:
>>> try:
>>> s = os.lstat(f)
>>> if S_ISDIR(s.st_mode):
>>> walk(f)
>>> except OSError, err:
>>> print err
>>> chdir('..')
>>>
>>> if len(sys.argv) != 2:
>>> print 'need 1 arg, directory to scan'
>>>
>>> os.chdir(sys.argv[1])
>>> cwd = os.getcwd()
>>> cwdlist = cwd.split('/')
>>>
>>> walk('.')
>>>
>>>
>> runs fine in a centos 6.8 container, no problem.
>>
>> I even have a couple of mount points with several thousand files and it
>> walks everything without a hitch.
>>
>> --
>> regards,
>> Natxo
>>
>>
>>
>> _______________________________________________
>> OmniOS-discuss mailing list
>> OmniOS-discuss at lists.omniti.com
>> http://lists.omniti.com/mailman/listinfo/omnios-discuss
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://omniosce.org/ml-archive/attachments/20170115/caba5cf0/attachment.html>
More information about the OmniOS-discuss
mailing list