<div dir="ltr">Hello,<br><br>I have a systemd service - drainconnections which I want to to make sure finishes stopping before systemd starts stopping another service. What I also want is to if I stop supervisord service, drainconnections should be stopped first.<div><br></div><div>It seems like BindsTo is what I need for establishing the coupling between the two units. The following unit file describes drainconnections:<br><br><br><div>[Unit]</div><div>Description=Drain Connections</div><div>After=supervisord.service</div><div>BindsTo=supervisord.service</div><div><br></div><div>[Service]</div><div>Type=oneshot</div><div>RemainAfterExit=True</div><div>ExecStart=/bin/true</div><div>ExecStop=/usr/bin/touch /var/shuttingdown1</div><div>ExecStop=/usr/bin/sleep 60</div><div>ExecStop=/usr/bin/touch /var/shuttingdown2</div><div><br></div><div>[Install]</div><div>WantedBy=multi-user.target</div><div><br></div><div><br></div><div>In addition, I also needed to add BindsTo=drainconnections to the supervisord service.</div><div><br></div><div>Things work as desired for me considering the above configuration.</div><div><br></div><div>Am I on the right track here? Thanks in advance.</div><div><br></div><div>Best Wishes,</div><div>Amit.</div><div><br></div><br><br></div></div>