Hi folks,

I would like to create a target unit to start and stop a group of services.
For example, I want a "my-apps.target" to start and stop "docker.service",
"sshd.service" and "mongodb.service". Here are my units and drop-ins:

    # /etc/systemd/system/my-apps.target
    [Unit]
    Wants=docker.service sshd.service mongodb.service # for starting

    # /etc/systemd/system/docker.service.d/my-apps.conf
    [Unit]
    PartOf=my-apps.target # for stopping

And the drop-ins for "sshd.service" and "mongodb.service" are similar.

Then I can use "systemctl start my-apps.target" and "systemctl stop
my-apps.target" to start and stop the 3 services.

However, it is a little bit tedious to write drop-ins for each service
units. Is there a directive for "my-apps.target" to propagate "stop"
operation to the 3 services? I was expecting something like
"PropagateStopTo=docker.service sshd.service mongodb.service".

Thanks!

John Lin
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to