4

Is there a precedence or order of operations for the performance of items in a systemd service unit configuration file?

For example, ExecStartPre operations obviously happen before ExecStart. And multiple ExecStartPre operations are each executed to completion, serially and in order. Also, ExecCondition operations are defined to happen before ExecStartPre (and with a very specific ordering/execution).

And the RuntimeDirectory operation/creation happens before ExecStart.

But does the RuntimeDirectory operation/creation necessarily happen after ExecStartPre completion? (my experiments suggest that it does, but I might have been fooled may be a race condition -- or have experienced an implementation-dependent behavior). Presumably RuntimeDirectory creation is also thus well after ExecCondition operations?

Similarly, do ExecStopPost operations necessarily happen before or after the RuntimeDirectory is removed?

Are there other subtle-but-implicit guaranteed orderings within a given service? Or, conversely, are there other operations that can happen in parallel (or otherwise have their ordering undefined)?

jhfrontz
  • 359
  • I'm not too sure, but I can see this maybe being in-order, or could vary across distros – Joe Jan 16 '20 at 03:26
  • 1
    Note that the idea of "implementation-dependent behaviour" does not really exist here. There is no standard, and there are not multiple implementations attempting to conform to a standard. There is only one software, and there is no specification distinct from its user doco describing whatever it does in its latest version. – JdeBP Jan 16 '20 at 06:56
  • 1
    @JdeBP I was using the term loosely (and perhaps subconsciously, as a gentle poke about the lack of a rigorous spec) -- as Joe points out, "the latest version" can vary across distros (hence, "implementation-dependent"). – jhfrontz Jan 16 '20 at 15:16

0 Answers0