Summary: | app-emulation/open-vm-tools default scripts break network connectivity on pause/resume | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Brian De Wolf <bldewolf> |
Component: | Current packages | Assignee: | Mike Gilbert <floppym> |
Status: | RESOLVED WORKSFORME | ||
Severity: | normal | CC: | vmware+disabled |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Brian De Wolf
2011-05-27 21:33:10 UTC
After re-reading my patch, it doesn't seem like sensible behavior, but the if statement I have changed still needs to be corrected. As it stands, it never works in the way it is implied that it should (that it should default to "network" instead of "net.eth0" if "net.eth0" doesn't exist, but as is the if statement can never be true). The patch will not work; the flaw seems to be that /etc/init.d/net.eth0 and /etc/init.d/network can both exist. The script doesn't determine which one was used to start the network services, it only determines if the given service is present. The route I've gone is to modify it this way: if [ $(/etc/init.d/net.eth0 -q status) ] instead of: if [ $(rc-service -e net.eth0) ] This will return zero if that given service is started. Either you've started with net.eth0, and if you didn't then you used /etc/init.d/network. --- network.orig 2011-12-03 05:55:54.000000000 +0100 +++ network 2011-12-03 05:56:16.000000000 +0100 @@ -50,7 +50,7 @@ # net.eth0, net.eth1, network, wicd, NetworkManager service="net.eth0" - if [ $(rc-service -e net.eth0) ] + if [ $(/etc/init.d/net.eth0 -q status) ] then service="net.eth0" else Of course, testing it properly would be better. Here's the script hacked up to work proper: #!/bin/sh # If you are not using /etc/init.d/network or /etc/init.d/net.eth0 #service="net.foo" if [ -n ${service} ]; then if [ $(/etc/init.d/net.eth0 -q status) ] || service="net.eth0" if [ $(/etc/init.d/network -q status) ] || service="network" fi case "$1" in suspend-vm) rc-service $service stop ;; resume-vm) rc-service $service start ;; *) ;; esac With 10.0.0, I reverted back to using upstream's network script. This should work with systemd, but may further break openrc systems. If someone can patch/test it to work with openrc as well, I would welcome the help. |