Starting Zato with systemd


#1

Maybe this was already obvious/widely known, but thought I’d share in case someone is searching for this:

In Ubuntu/Debian for instance, when you install Zato 2.x/3.x with the packages as described at https://zato.io/docs/admin/guide/install/ubuntu.html

The package automatically creates a systemd zato.service defined by this unit:

The package also installs /etc/init.d/zato which tries to read components that are symlinked at /etc/zato/components-enabled/

The README at /etc/zato/components-enabled states

Each Zato component - servers, web-admin instances or load-balancers - that needs to be covered by startup scripts,
and run when the operating system is starting, should be symlinked to in this directory.

For instance, to start on boot servers from ..

/opt/zato/prod/server1
/opt/zato/prod/server2

.. the following symlinks should be created:

$ ln -s /opt/zato/prod/server1 /etc/zato/components-enabled/prod.server1
$ ln -s /opt/zato/prod/server2 /etc/zato/components-enabled/prod.server2

So, if you deploy/configure zato with a tool like ansible for instance, you can just add these symlinks in the appropriate part of your process, and you can then let systemd start and manage zato!