https://serverfault.com/questions/785127/how-to-stop-systemd-services-in-specific-order/785355
You control the shutdown order by specifying Before= and After= in the unit files to describe the startup order. The inverse order is applied when shutting down.
Here's what the official docs have to say about it:
...when two units with an ordering dependency between them are shut down, the inverse of the start-up order is applied. i.e. if a unit is configured with After= on another unit, the former is stopped before the latter if both are shut down...
【 在 Mullet 的大作中提到: 】
: 启动时会根据.service中的Before、After、Wants、Requires来控制,那停止的时候呢?是不是就正好是跟启动相反的顺序?后启动的先停止?