[systemd-devel] [PATCH] service: Allow mainpid to restart in other than SERVICE_EXEC_START.

Alexander E. Patrakov patrakov at gmail.com
Mon Jan 10 07:22:25 PST 2011


10.01.2011 18:57, Mirco Tischler wrote:
> This patch should fix it. Can you test it? The problem was that after a
> the mainpid exits,
> and because there are commands left to execute systemd assumes it
> executes an ExecStart
> line from a type=oneshot service file. But in this case it executes an
> ExecReload line.
> This patch simply removes the assumptions. AFAICT this should work.

On the second thought, I am not sure that I fully agree with the patch. 
On IRC, we agreed that it is invalid to try to change the main PID from 
within the ExecReload line.

As far as I understand the comment above, the assertion hits if there 
are more commands to execute after the main PID exits. This can happen 
legitimately (without invalid service files) due to bad timing: a buggy 
service was crashed by an external hacker at the same time when the 
admin attempted to apply the new configuration. So it is indeed wrong to 
fail the assertion due to it, as it would be a security hole. However, 
in my opinion, it is also suboptimal (and maybe even wrong) to continue 
executing new commands when it is clear that the main PID no longer 
exists although it should - i.e., the service died.

-- 
Alexander E. Patrakov


More information about the systemd-devel mailing list