teamd: add Before=network.target to systemd service file

teamd.service actually is managed by network.service in ifup(down)Team, which
means it should not be started or shutdown by systemd when system boot/shutdown.
but now when system is shutdown, systemd may closed the teamd.service before
closing the network.service if it find teamd is active.

there exists an issue: if another service depends network.servie, maybe teamd
service will shutdown ealier than it. cause systemd close them concurrently. but
if it is necessary for that service to ensure the iface up, that service will
not be able to work.

this issue also exits in nfs over team.

so we can fix it by adding Before=network.target to systemd service file to make
sure teamd service will shutdown by network.service in ifdownTeam script.

it can work well without side effects. for booting, teamd@.service has no
[install] field and is always in disabled status, so systemd never start it
automatically. for shutdown, ifdown-Team will stop it by "/usr/bin/systemctl
stop teamd@${DEVICE}.service...". then systeamd won't stop it automatically
again.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
1 file changed