[CentOS] Runing multiple daemons with systemctl

Tue Sep 2 18:00:37 UTC 2014
James Hogarth <james.hogarth at gmail.com>

On 2 September 2014 18:43, Darod Zyree <darodzyree at gmail.com> wrote:

>
>
> ExecStartPre=, ExecStartPost=
>
>     Additional commands that are executed before or after the command in
> ExecStart=, respectively. Syntax is the same as for ExecStart=, except
> that multiple command lines are allowed and the commands are executed
> one after the other, serially.
>


Given his criteria I really would not go down this route ...

The Pre/Post stuff is meant to be one shot commands that  exit cleanly and
is for config testing or creation of ssh keys (for an example of one
instance).

They are not really designed for this as the process that is backgrounded
for the first daemon would not be tracked as a service in systemd.

It's far more useful from a maintenance/diagnostic/simplicity perspective
to do two separate service unit files with appropriate dependencies.