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

Lennart Poettering lennart at poettering.net
Mon Jan 17 15:18:59 PST 2011


On Mon, 10.01.11 20:22, Alexander E. Patrakov (patrakov at gmail.com) wrote:

> 
> 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.

Hmm, wasn't around when this discussion happened. What is the reason
cited for not allowing dynamically changing main pids? There might be
some but at least right now I cannot see any.

To me it appears right now that you just found a couple of bugs and
something like:

ExecStart=/path/to/check-config
ExecStart=/path/to/start-new-instance
ExecStart=/path/to/stop-old-instance

(where the last line might just be an invocation of kill) 

should actually work after we fixed those bugs.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list