Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please migrate away from net-tools #446

Closed
cpaelzer opened this issue Jul 1, 2020 · 6 comments
Closed

Please migrate away from net-tools #446

cpaelzer opened this issue Jul 1, 2020 · 6 comments

Comments

@cpaelzer
Copy link

cpaelzer commented Jul 1, 2020

Hi,
net-tools like netstat, ifconfig and such are deprecated and replaced by newer tools.
These packages are meant to be faded out by many distributions.

We recently had the discussion with the sdmp plugin and I'm glad you provided 64db1c0 for that.
But triggered due to this we found that e.g. ifconfig is in use as well.

$ grep -Hrn ifconfig *
debian/changelog:19:    Various scripts still use ifconfig.
debian/manpages/vmxnet.9:15:   for ethif in `ifconfig \-a | grep ^eth | cut \-d' ' \-f1`; do
open-vm-tools/modules/solaris/vmxnet/vmxnet.c:571: *    Device start routine. Called on "ifconfig plumb"
open-vm-tools/modules/solaris/vmxnet/vmxnet.c:664: *    Device stop routine. Called on "ifconfig unplumb"
open-vm-tools/scripts/linux/network:24:# Using a combination of a system networking script, ifconfig, ifup, ifdown
open-vm-tools/scripts/linux/network:356:   # otherwise fall back to the ifconfig command.
open-vm-tools/scripts/linux/network:357:   # ifconfig is buggy on some platforms and truncates long
open-vm-tools/scripts/linux/network:364:      for nic in $($ifconfig_cmd | sed -n 's/^\([^: \t]*\).*$/\1/p'); do
open-vm-tools/scripts/linux/network:365:         intf_out=$($ifconfig_cmd $nic)
open-vm-tools/scripts/linux/network:393:            intf_out=$($ifconfig_cmd $nic)
open-vm-tools/scripts/linux/network:541:#    request. So far, it requires either ip or ifconfig command to read
open-vm-tools/scripts/linux/network:549:   ifconfig_cmd=$(which ifconfig 2>/dev/null)
open-vm-tools/scripts/linux/network:553:   [ -z "$ifconfig_cmd" -a -z "$ip_cmd" ] && \
open-vm-tools/scripts/linux/network:554:       Panic "ip and ifconfig not in search path."
open-vm-tools/scripts/common/vm-support:341:runcmd "/tmp/ifconfig.txt" ifconfig -a
open-vm-tools/scripts/solaris/network:28:# Solaris's ifconfig conveniently handles DHCP arguments directly, so we
open-vm-tools/scripts/solaris/network:61:         for nic in `ifconfig -a | awk -F: '/DHCP/ { print $1; }'`; do
open-vm-tools/scripts/solaris/network:65:            if ifconfig "$nic" dhcp status > /dev/null 2>&1; then
open-vm-tools/scripts/solaris/network:68:               ifconfig "$nic" dhcp release
open-vm-tools/scripts/solaris/network:76:               ifconfig "$nic" dhcp
open-vm-tools/scripts/solaris/network:80:               rc=$? && [[ $rc != 0 ]] && { ifconfig "$nic" dhcp ping; rc=$?; }
open-vm-tools/lib/netUtil/netUtilLinux.c:240: *      first interface that comes up when you do a ifconfig.

I wanted to ask if you could try to migrate to ip for these.

For the sake of being a VMware page I think this howto is the best one to link for this :-)

@oliverkurth
Copy link
Contributor

oliverkurth commented Jul 1, 2020

If you look more closely, you will see that most hits are comments. In open-vm-tools/scripts/linux/network, the code checks for ip first, and only falls back to ifconfig if the former isn't available. The Solaris script can be ignored. The only script where we just rely on ifconfig is in the vm-support script. I'll file an internal bug for that, fix should be trivial. There is also a netstat there that can be replaced.

I hope I am not missing anything.

@cpaelzer
Copy link
Author

cpaelzer commented Jul 2, 2020

Thanks @oliverkurth , yeah I've already seen that quite a bunch are comments and have fallbacks.

I know we have talked about the same on the sdmp plugin, and I just wanted to make sure the remaining few will be sorted before the next release so that we can again drop the net-tools dependence which Bernd correctly added when seeing this recently.

Thanks for passing that to an internal bug, looking forward to see the next 11.x release fully non net-tools compatible.

@MaxPeal
Copy link

MaxPeal commented Sep 21, 2020

@oliverkurth Please add also fallbacks to ifconfig / netstat.

as i have seen in the commit its without fallback 64db1c0

or should i make a PR?

@johnwvmw
Copy link
Contributor

johnwvmw commented Sep 21, 2020

@cpaelzer Unfortunately the change for the Linux vm-support script missed the window for the next major point release of open-vm-tools. It is scheduled for the follow-up maintenance update.

@johnwvmw
Copy link
Contributor

johnwvmw commented Sep 21, 2020

@MaxPeal are you requesting that the vm-support script discussed earlier fall back to ifconfig/netstat? That is what we intend to do.

Or, are you requesting that the Service Discover scripts referenced in the stable-11.1.0-SDMP-fixes fall back to ifconfig/netstat?

If the latter, it would probably be better to track the request as as a new issue.

Thanks,

johnwvmw added a commit that referenced this issue Mar 5, 2021
The "ifconfig" and "netstat" commands are deprecated in more recent
releases of Linux.  Update the Linux vm-support script to use the "ip"
and "ss" commands when available.

If Available:         Fallback:
     ip                   ifconfig
     ip route             route
     ss                   netstat

Addresses: #446
@johnwvmw
Copy link
Contributor

johnwvmw commented Jul 28, 2021

This issue was resolved with change 9bdfa71 and part of open-vm-tools 11.3.0.

Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants