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(a)${DEVICE}.service...". then systeamd won't stop it automatically
again.
Signed-off-by: Xin Long <lucien.xin(a)gmail.com>
---
teamd/redhat/systemd/teamd@.service | 1 +
1 file changed, 1 insertion(+)
diff --git a/teamd/redhat/systemd/teamd@.service b/teamd/redhat/systemd/teamd@.service
index 7dfec14..3a39a26 100644
--- a/teamd/redhat/systemd/teamd@.service
+++ b/teamd/redhat/systemd/teamd@.service
@@ -1,5 +1,6 @@
[Unit]
Description=Team Daemon for device %I
+Before=network.target
[Service]
BusName=org.libteam.teamd.%i
--
2.1.0