[CRIU] [PATCH] test: add rpc tests

Pavel Emelyanov xemul at parallels.com
Sun Sep 15 16:33:17 EDT 2013


>>>>>> +echo PID ${SRV_PID}
>>>>>> +sleep 1 #server needs some time to initialize
>>>>> I don't like this sleep. Your service is able to detach
>>>>>
>>>>> -d|--daemon           run in the background after creating socket
>>>>>
>>>>> so if it will be executed with the -d option, this sleep will be
>>>>> unnecessary.
>>>>>
>>>> The reason why i didn't use daemonization is that i don't know how
>>>> to get his pid in the script it that case.
>>>>
>>> I mean, i'm not sure, but it looks like after deamon() process has
>>> another pid.
>> Yes, it will.
>>
>>> And if i write "criu service -d", ${!} gives me pid that criu has at
>>> the beginning, and i can't terminate server afterwards.
>>> I thought, i can pkill criu, but it looks wrong.
>> Can we use --pidfile? If this option is specidied, the server saves it's
>> PID in the file.
> 
> I sent a patch for this, but still, i need to use "sleep 1", otherwise i 
> get "No such file or directory" when test-c is trying to connect to 
> socket. And it looks strange to me, because daemonization is run _after_ 
> creating a socket.
> What am I doing wrong now?

Good question :) Try to debug this thing.


More information about the CRIU mailing list