[CRIU] Cannot run zdtm.py script, flock problem

Pavel Emelyanov xemul at parallels.com
Tue Jan 26 02:46:43 PST 2016


On 01/25/2016 08:57 PM, Rodrigo Bruno wrote:
> Hi,
> 
> On Mon, 25 Jan 2016 12:38:14 +0300
> Pavel Emelyanov <xemul at parallels.com> wrote:
> 
>> On 01/23/2016 11:09 PM, Rodrigo Bruno wrote:
>>> Hi,
>>>
>>> I was trying to run tests using the zdtm.py script.
>>>
>>> However, when running "./zdtm.py run -a":
>>>
>>> flock: ./zdtm_mount_cgroups: Text file busy
>>> Traceback (most recent call last):
>>>   File "./zdtm.py", line 1403, in <module>
>>>     tst.available()
>>>   File "./zdtm.py", line 436, in available
>>>     subprocess.check_call(["flock", "zdtm_mount_cgroups", "./zdtm_mount_cgroups"])
>>>   File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
>>>     raise CalledProcessError(retcode, cmd)
>>> subprocess.CalledProcessError: Command '['flock', 'zdtm_mount_cgroups', './zdtm_mount_cgroups']' returned non-zero exit status 69
>>>
>>> This problem seems to happen because flock is trying to lock the script it is going
>>> to run.
>>>
>>> Has anyone got the same problem?
>>>
>>> Is this lock important?
>>
>> Yes, this is needed to pre-mount cgroups only once when we run several zdtm.py-s
>> in parallel.
>>
>>> I'm able to run all tests I if remove the flock command.
>>
>> OK, so while you don't run zdtm.py-s in parallel, you can move forward without
>> one. But once time permits, can you investigate why flock behaves like that?
> 
> I found an old discussion about this:
> http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/4997
> 
> Is seems that the flock version that is distributed in all Ubuntu and Ubuntu-based 
> systems (2.20.1) does not allow locking the script it is going to execute.
> 
> I cloned and compiled util-linux (https://github.com/karelzak/util-linux) and the
> resultant flock already works.
> 
> A possible solution, if you think this is a problem, is to create a lock file 
> (not using the script file as lock).

OK, thanks for the investigation :)

-- Pavel



More information about the CRIU mailing list