On Fri, Jul 15, 2016 at 4:31 PM, Derek Mahar <derek.ma...@gmail.com> wrote:

> This is an interesting development.
>
> How is sd_notify related to a service of Type=notify?
>

When a service is declared Type=Notify: it is expected that the daemon
sends a notification message via sd_notify(3) or an equivalent call when it
has finished starting up (
https://www.freedesktop.org/software/systemd/man/systemd.service.html#Type=)
When you start a container, you use systemd-nspwan and it sends the "ready
message" as soon as the container started not when it is ready.

I implemented a new option in systemd-nspawn that allows to delegate this
responsibility to the container itself and I am working to make it work in
rkt, however this feature will probably available after coreos will use
system v231.

>
> While the container is a highly useful extension or derivative of the
> process concept, it surprises me that containers don't better expose or
> promote useful inter-process communication mechanisms such as semaphores,
> signals, pipes, or message queues to facilitate container coordination on a
> host.
>
> Derek
>
> On Friday, 15 July 2016 05:51:30 UTC-4, Alban Crequy wrote:
>>
>> Hi,
>>
>> There is work going on to implement systemd's mechanism for notifying
>> when an application is ready (sd_notify):
>> https://github.com/coreos/rkt/issues/1464
>>
>> That's useful when the rkt pods are started as systemd services. When
>> this work in rkt is done, a rkt pod (e.g. PostgreSQL) would be able to
>> notify systemd on the host when it is ready to receive requests (fully
>> initialized), and systemd on the host could then only start other
>> dependencies (e.g. another rkt pod connecting to PostgreSQL).
>>
>> For this to work, applications must implement the sd_notify mechanism.
>> But I see that PostgreSQL has support for sd_notify:
>>
>> https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=7d17e683fcc28a1b371c7dd02935728cd2cbf9bf
>>
>>
>> Since sd_notify is not there yet in rkt, it is more difficult but in
>> some cases it is possible to use socket activation when the dependency
>> can be expressed in terms of a client connecting to the socket of a
>> server. See "Socket-activated service":
>> https://coreos.com/rkt/docs/latest/using-rkt-with-systemd.html
>>
>> Cheers,
>> Alban
>>
>> On Fri, Jul 15, 2016 at 2:15 AM, Derek Mahar <derek...@gmail.com> wrote:
>> > What is the recommended approach to synchronizing containers in
>> CoreOS?  For
>> > example, how might CoreOS ensure the following container execution
>> order at
>> > startup?
>> >
>> > 1. Start PostgreSQL Server
>> > 2. Create schema (using separate one-shot Liquibase container)
>> > 3. Launch application
>> >
>> > The application cannot run without its database schema and Liquibase
>> cannot
>> > create the database schema without PostgreSQL Server being ready to
>> receive
>> > SQL statements.  Which mechanisms in CoreOS can we use to guarantee
>> this
>> > ordering?
>> >
>> > Thank you,
>> >
>> > Derek
>>
>


-- 

Alessandro Puccetti

Reply via email to