Lebgitimate syntax for ExecStop

I have modified /usr/lib/systemd/system/wicked.service at the ExecStop line to read:

ExecStop=/usr/bin/systemctl stop openvswitch.service; /usr/sbin/wicked --systemd ifdown all

This does work, and does solve my problem. My question is:

Is this a legitimate syntax (it obviously works) or is there a better approach to insure that the openvswitch.service stops before the interfaces are downed.

AFAIK this should be triggered by Before= or After= statements. But, if this works now, I’d first do some serious studying on systemd, before changing it.

Yes. Although it means that you now have two services to stop instead of one, so timeouts systemd applies are wrong. Also any “systemctl daemon-reload” run concurrently (there are too many of them unfortunately) would terminate the first systemctl, thus it is open to race condition.

or is there a better approach

I already told you - use STARTMODE=nfsroot for your bridge.

Actually I’d say it is a bug in wicked - it should not destroy interfaces that it did not create. I.e. your case should work by omitting OVS_* variables and treating OVS interfaces just like any other. Care to file bug report?

I must have missed the STARTMODE you suggested.

I will also remove the OVS part.

I am happy to file a bug report. I was still trying to determine if I had a bug, or if I was misunderstanding something.

I will test your suggestions first.

Thank you.

You might also want to read the Help and MAN documentation relating to “Requires =” and “Before =” and “After =”


Usually people write these options to start, and pay less attention to stopping.
You’ll probably want to carefully pick through the info on this page to make sure very detail is covered.

I’m guessing that properly <combining> Requires = and After = other referenced Unit files for those services should be the proper syntax.


Thank you for the link.I did read the manpages. I solved it a different way with arvidjarr’s advice in the post below, and submitted a bug report as advised.


I also informed the openvswitch discussion list, although they didn’t seem to responsive to my minuscule issues :slight_smile:

There is nothing to be done from openswitch side here.

I agree. I only informed them to help anyone who runs across the same behavior. I didn’t expect them to fix anything on their side.