Systemd service life cycle

Colin Law clanlaw at gmail.com
Thu Apr 7 07:43:47 UTC 2016


On 6 April 2016 at 22:33, Tom H <tomh0665 at gmail.com> wrote:
> On Wed, Apr 6, 2016 at 11:01 PM, Colin Law <clanlaw at gmail.com> wrote:
>>
>> I am trying to define the startup order of a couple of systemd
>> services.  I see in the docs how I can use After, Before etc to
>> control the order. What is not clear to me is at exactly what point
>> in the startup of a service it becomes "Started", thereby allowing the
>> next service to be started.
>
> If B has "Requires=A" and "After=A", it'll start after A has been started.

Thanks Tom, I had managed to glean that much from the docs.  The
question is, though, what is meant by "Started"?  I have an operation
performed by A that I need to be completed before B is started (I am
setting up an ssh tunnel to a server that B uses).  Currently I do
that first thing in the script invoked by ExecStart but sometimes B is
started before the tunnel is up.  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.  If I am correct then I think I should put the
tunnel setup in ExecStartPre.

Cheers

Colin

>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users



More information about the ubuntu-users mailing list