Edex-ui: Dependency on ifconfig

Created on 21 Nov 2018  Â·  15Comments  Â·  Source: GitSquared/edex-ui

Looks like there's an implicit dependency on ifconfig being present. Probably a good idea to have a graceful fallback on that, as in my case it wasn't installed by default, and in some distros (such as Ubuntu), it's being moved away from completely in preference to ip. Perhaps check for both and fail gracefully if neither are found.

bug

All 15 comments

This is probably due to systeminformation. I'll investigate this more deeply.

Can you confirm not having ifconfig installed does prevent some features to work correctly / gives you an error message?

I can confirm not having it installed causes errors. However, there seem to be a few different issues. Installing net-tools did stop that error from coming up on the underlying console, but i'm not sure what effect it had on the ui.

Could you give me the exact error? I think i know where it comes from but i want to be sure.

Not an error that your console mentions, it's literally bash outputting this error over and over:

/bin/sh: 1: /sbin/ifconfig: not found

i have a docker build if you want to play with it:

sudo docker run -it --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix bannsec/edex-ui-docker

To re-create this error, once it's running open another window in that docker container and simply remove net-tools.

On NixOS, it doesn't seem to matter if ifconfig is on the $PATH.

/bin/sh: /sbin/ifconfig: No such file or directory
✖  error     TypeError: Cannot read property 'replace' of undefined: Uncaught TypeError: Cannot read property 'replace' of undefined
⬤  debug     at $HOME/.cache/appimage-run/6e2f4142bf0a212a945d51ea7e53277098e5894b32cc66d0438a76ffc8425f3b/squashfs-root/resources/app.asar/node_modules/systeminformation/lib/memory.js 120:32

So, funny thing, I actually reported this on systeminformation a while back. I proposed a solution that the maintainer of this project used to fix the issue.

tl;dr of the whole conversation is that he added a test to see if ip is available and the library would either use that or fallback to ifconfig. This was in March 2018 and that code is still up

I double-checked the possibly related files in eDEX, but i just don't see where this ifconfig launch is coming from.

Just thought i'd share some progress.

(Also, on my own machine - running Debian 9 - i don't have ifconfig installed. No errors on my end.)

OK I think i got it. Look at how systeminformation checks for ip.

Could it be that the ip exec is elsewhere than /sbin/ ? @bannsec @eadwu
If so i'd like to know where it's stored on your machines and i'll send a PR up to the library.

Yes, /sbin doesn't exist in NixOS, but ip and ifconfig exist on the $PATH, so using whereis or command -v would be better, though there is a symlink at /run/current-system/sw/bin/ip.

Thanks for the confirmation. I'll make an upstream PR.

Also ip and ifconfig are both technically in optional packages and so may
not be present.

On Fri, Nov 23, 2018, 9:59 AM Git² <[email protected] wrote:

Thanks for the confirmation. I'll make an upstream PR.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/GitSquared/edex-ui/issues/227#issuecomment-441275031,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AHR34OGYt3zMHNZfLLiUVM06halYjXhkks5uyBtVgaJpZM4YtxdZ
.

@eadwu @bannsec Apart from the edgecase where neither ip nor ifconfig are present, can you confirm the issue is resolved?

Looking good so far. https://i.imgur.com/qgaHztl.jpg

Honestly loosing track of which errors are associated with which tickets. In any case, here's my current image. It does claim i'm offline, and no network usage tracking graph.
current

Should be good regarding to this issue i think. Closing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bdgza picture bdgza  Â·  3Comments

jwulf picture jwulf  Â·  5Comments

GitSquared picture GitSquared  Â·  6Comments

clragon picture clragon  Â·  6Comments

tztl0 picture tztl0  Â·  4Comments