[CRIU] [PATCH] Show error messages when failing early in the init process
Dmitry Safonov
0x7f454c46 at gmail.com
Wed Sep 11 14:46:37 MSK 2019
Hi Nicolas,
On Sat, 7 Sep 2019 at 07:57, Nicolas Viennot
<Nicolas.Viennot at twosigma.com> wrote:
[..]
> @@ -162,7 +165,8 @@ int main(int argc, char *argv[], char *envp[])
> pr_warn("Stopped and detached shell job will get SIGHUP from OS.\n");
>
> if (chdir(opts.work_dir)) {
> - pr_perror("Can't change directory to %s", opts.work_dir);
> + pr_msg("Error: Can't change directory to %s: %s\n",
> + opts.work_dir, strerror(errno));
> return 1;
> }
Please, separate this part from the rest of the patch.
This doesn't look like a proper fix.
Also, I believe it should go into early buffer.
+Cc: Adrian
The reason you don't see the message is probably because criu exits
earlier than flushes
that early print buffer. I would think that the better fix would be to
flush the early buffer in
a function with __attribute__((destructor))..
Thanks,
Dmitry
More information about the CRIU
mailing list