On Thu, 26.11.15 12:27, eshark (eshar...@163.com) wrote:

> 
>    Hi, all,
> 
>     It seems that  the exec_spawn() will return 0 if fork() fails,  because  
> that
>                 return log_unit_error_errno(params->unit_id, errno, "Failed 
> to fork: %m");
>  will return -r eventually.  And here r = exec_context_load_environment() , 
> which has 
>  exited successfully.
> 
>    This may lead big trouble to the caller of  exec_spawn().  For example,  
> mount_spawn(), which 
> also calls exec_spawn(), will not goto fail but run continuelly in this case. 
> Then the following unit_watch_pid()
> will fail  at assert(pid >= 1);. 
> 
>    I also commit a patch to fix this problem, please help to review.

Indeed, this is a bug! Patch looks great! I turned this now into a
github PR (https://github.com/systemd/systemd/pull/2048), because
that's how we prefer submissions these days. Will merge as soon as the
CI likes it too.

Thanks a lot!

Lennart

-- 
Lennart Poettering, Red Hat
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to