Sample Header Ad - 728x90

Start and stop systemd units in the same order

2 votes
1 answer
370 views
How am I supposed to do this in systemd? start unit.A started unit.A start unit.B started unit.B stop unit.A stopped unit.A stop unit.B stopped unit.B --- I know After=/Before= will order units in reverse on start/stop like AB -> BA, but I need AB -> AB. My guess is, that I have to merge unit.A with unit.B, something along the lines of *unit.A.service:* ExecStartPost=unit.A And handle stop ordering in ExecStopPost=. **EDIT:** It seemed that a combination of Upholds= and PropagatesStopTo= would probably give me what I want, or very close, but it turns out, those are added in systemd version 249, but I have to get it running on 241/247. I still have an academic interest in whether Upholds= and PropagatesStopTo= would have been the right call, had I access to systemd 249?
Asked by Zoltan K. (603 rep)
Sep 12, 2021, 10:36 AM
Last activity: Oct 7, 2021, 09:25 AM