Systemd service life cycle

Ralf Mardorf silver.bullet at zoho.com
Thu Apr 7 09:08:41 UTC 2016


On Thu, 7 Apr 2016 09:31:42 +0100, Colin Law wrote:
>On 7 April 2016 at 09:17, Ralf Mardorf <silver.bullet at zoho.com> wrote:
>> On Thu, 7 Apr 2016 08:43:47 +0100, Colin Law wrote:  
>>>This leads me to think that A is defined as Started once ExecStart
>>>has been called, but only guarantees that the script has been
>>>initiated, not that it has actually accomplished anything.  
>>
>> Systemd is known for race conditions. I would let a wrapper B check
>> against A being ready.  
>
>Thanks Ralf, could you explain exactly what you mean by that?  Do you
>mean I should just make B hang until the tunnel is up?

Yes. Fortunately I don't experience a systemd race condition, IOW I
don't do it myself, I just would do it this way, assumed I would
experience such an issue.

>In fact I don't really want to do anything special in B at all if I can
>manage it, as it is a standard service (openHAB) and if I hack
>the .service file it may get overwritten if openHAB is upgraded.
>
>I wonder whether I could put the wait in ExecStartPost, but that would
>only work if the service is not marked as Started until after
>ExecStartPost returns.  There must be an answer to this problem, I am
>sure I am not the first to come across this issue.

I guess you're right.

Unfortunately there's no systemd user mailing list, perhaps requests for
help are allowed at the devel list,
https://lists.freedesktop.org/mailman/listinfo/.






More information about the ubuntu-users mailing list