[systemd-devel] Question about ExecStartPost= and startup process

Andrei Borzenkov arvidjaar at gmail.com
Mon Jun 29 01:05:49 PDT 2015


On Mon, Jun 29, 2015 at 11:01 AM, Francis Moreau <francis.moro at gmail.com> wrote:
> On 06/28/2015 07:21 PM, Reindl Harald wrote:
>>
>>
>> Am 28.06.2015 um 19:02 schrieb Francis Moreau:
>>> On 06/28/2015 01:01 PM, Reindl Harald wrote:
>>>>
>>>> Am 28.06.2015 um 12:00 schrieb Francis Moreau:
>>>>> Hello,
>>>>>
>>>>> For services with Type=Forking, I'm wondering if systemd  proceeds
>>>>> starting follow-up units when the command described by ExecStart= exits
>>>>> or when the one described by ExecStartPost= exits ?
>>>>>
>>>>> I tried to read the source code to figure this out and it *seems* that
>>>>> the latter is true but I'm really not sure.
>>>>
>>>> after ExecStartPost because anything else would make no sense, a unit is
>>>> started when *all* if is st started - see the recent mariadb units on
>>>> Fedora - if systemd would fire up deaemons which depend on mariadb the
>>>> whole "wait-ready"-stuff won't work
>>>
>>> Ok, then the next naive question would be: "then what the purpose of the
>>> ExecStartPost= directive since several commands can already be 'queued'
>>> with the ExecStart= one?
>>
>> no, they can't, not for every service type
>> "When Type is not oneshot, only one command may and must be given"
>>
>> read http://www.freedesktop.org/software/systemd/man/systemd.service.html
>>
>
> correct, I was actually confused by what I read from the source code:
>
> service_sigchld_event() {
>         ...
>         } else if (s->control_pid == pid) {
>                 ...
>                 if (s->control_command &&
>                         s->control_command->command_next &&
>                         f == SERVICE_SUCCESS) {
>                         service_run_next_control(s);
>                 }
>
> this looks like that forking type services could had several commands
> queued in ExecStart directive...
>

IIRC this is checked when unit definition is parsed.


More information about the systemd-devel mailing list