systemd unit ExecStop runs after network has finished, but requires network to stop

Solution Unverified - Updated -

Issue

  • systemd unit ExecStop runs after network has finished, but requires network to stop
  • systemd unit contains Requires=network.target and After=network.target but NetworkManager Team network interface stops before the systemd unit stops. When using Ethernet or Bond network interface, the service stops fully before the network is down
  • What needs to be put in a systemd service file in order that the ExecStop script gets executed completely before the network is shut down?

Environment

  • Red Hat Enterprise Linux 7.1
  • NetworkManager running Team network interface
  • systemd service unit file whose ExecStop requires network connectivity to properly shut down

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content