[CRIU] [PATCH 0/2] write pidfile before chdir /, if going daemon

Pavel Emelyanov xemul at parallels.com
Fri Nov 1 02:58:26 PDT 2013


On 11/01/2013 05:51 PM, Ruslan Kuprieiev wrote:
> On 31.10.2013 16:32, Pavel Emelyanov wrote:
>> On 10/31/2013 04:54 AM, Ruslan Kuprieiev wrote:
>>> On 30.10.2013 16:30, Pavel Emelyanov wrote:
>>>> On 10/30/2013 03:27 AM, Ruslan Kuprieiev wrote:
>>>>> Now we're unable to use relative pidfile path with -d option, because
>>>>> criu chdir to /, before writing pidfile. So lets go daemon without
>>>>> chdiring to /, write pidfile(if needed) and chdir("/"), as well.
>>>>>
>>>>> Ruslan Kuprieiev (2):
>>>>>     service: write pidfile before chdir to /, if going daemon
>>>>>     page-server: write pidfile before chdir to /, if going daemon
>>>>>
>>>>>    cr-service.c | 14 +++++++++++++-
>>>>>    page-xfer.c  | 19 ++++++++++++++++---
>>>>>    2 files changed, 29 insertions(+), 4 deletions(-)
>>>>>
>>>> I wouldn't introduce such complexity, but made sure, that -D option
>>>> works properly for daemon and pid file with relative path is put
>>>> under -D.
>>> -D with daemon means that daemon shouldn't chdir /, and should stay
>>> where -D will point?
>> Yes.
> Btw, if I do this:
>      criu check -D foodir -o foolog
> 
> logfile is created in foodir, and if I do this:
>      criu check -o foolog -D foodir
> 
> logfile is created in current directory.
> Is this a right behavior? Or should we resolve -o,--pidfile options and 
> then, after processing all opts, do chdir?

I think yes. It's a long-standing bug in criu. All relative paths from command line
should be relative to -D one. Even if we're launching a service, that goes daemon.


More information about the CRIU mailing list