I have two services running in CoreOS, servicea
and serviceb
. When servicea
starts and is ready, I need to run serviceb
to run some commands against servicea
.
What is the best way to tell systemd to start that serviceb
when servicea
starts? Trying to read through the systemd documentation and after trail and error has landed me right here .
Here is an example fcct (or butane now?) YAML file:
variant: fcos
version: 1.3.0
systemd:
units:
- name: consul.service
enabled: true
contents: |
[Unit]
# unit stuff here
[Service]
ExecStart=/usr/local/bin/servicea
[Install]
WantedBy=serviceb.service
RequiredBy=serviceb.service
- name: serviceb.service
enabled: false
contents: |
[Unit]
Requires=servicea.service
Wants=servicea.service
[Service]
Type=oneshot
ExecStart=/usr/local/bin/serviceb.sh
[Install]
WantedBy=servicea.service