3

With the WantedBy= install directive and Before= unit directive in the unit config for a oneshot service B, I can start B when another service A is (re)started. However, I'm not sure how to configure B.service such that it also starts before A is reloaded.

I've looked at the ReloadPropagatedFrom= directive, but it implies that a reload of A.service will trigger a reload of B.service, not a start of B.service.

2
  • Have you actually tried ReloadPropagatedFrom or just read the documentation. Jul 10, 2020 at 14:08
  • I did try it and it didn't seem to have any effect on the dependent service, i.e. reloading A didn't seem to do anything to B. Jul 10, 2020 at 17:32

1 Answer 1

2

If there is no "good" solution within SystemD then you can make the reload part of the unit file. Just prepend the existing ExecReload entry with another one:

ExecReload=systemctl restart B
1
  • 1
    Alright, thanks. For those needing to do this in an override, clear ExecReload first. [Service] ExecReload= ExecReload=systemctl restart B ExecReload=<original ExecReload> Jul 14, 2020 at 17:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .