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

optionally run iiab-network when wifi is present #175

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jvonau
Copy link
Contributor

@jvonau jvonau commented Jul 26, 2021

The only time the network role is really needed is with wifi present otherwise the install is just using the os provided networking.

@jvonau
Copy link
Contributor Author

jvonau commented Jul 26, 2021

in support of iiab/iiab#2876

@tim-moody
Copy link
Contributor

I'm not clear on the relationship between iiab-install and iiab-complete.

@@ -429,6 +429,11 @@ fi

touch $FLAGDIR/iiab-complete

if ! [[ $(ls -la /sys/class/net/*/phy80211 | awk -F / '{print $5}' | wc ) == 0 ]]; then
Copy link
Member

@holta holta Jul 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the suggestion (further below) also work?

If so, it suppresses this error on non-WiFi systems:

root@box:~# ls -la /sys/class/net/*/phy80211 | awk -F / '{print $5}' | wc
ls: cannot access '/sys/class/net/*/phy80211': No such file or directory
      0       0       0
root@box:~# ls -la /sys/class/net/*/phy80211
ls: cannot access '/sys/class/net/*/phy80211': No such file or directory

FWIW 2>/dev/null would also work below, if preserving STDOUT is desired:

Suggested change
if ! [[ $(ls -la /sys/class/net/*/phy80211 | awk -F / '{print $5}' | wc ) == 0 ]]; then
if ls /sys/class/net/*/phy80211 &>/dev/null; then

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be useful to know why iiab-network is not being run, lack of phy80211 in any of the interfaces...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently this PR does not display STDOUT e.g. network devices like ap0 and wlan0.

If you want to display both STDOUT and STDERR, here's one rudimentary (bare bones) option:

if ls -d1 /sys/class/net/*/phy80211; then

When run, it shows stuff like...

root@box:~# if ls -d1 /sys/class/net/*/phy80211; then :; fi
/sys/class/net/ap0/phy80211
/sys/class/net/wlan0/phy80211
root@box:~# if ls -d1 /sys/class/net/*/phy80211; then :; fi
ls: cannot access '/sys/class/net/*/phy80211': No such file or directory

Copy link
Member

@holta holta Jul 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note that this PR's original if statement always returns True.
That aspect can be fixed with wc -l instead of wc.

However that's not a comprehensive fix, as it still does not display STDOUT.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really care what the syntax you decide to push is just make it happen so users that use the 'iiab' script outside of the intended target of supporting offline wifi serving of web content can continue to muck around without bothering to read any of the docs, reducing frivolous requests for support of their local network layout.

@jvonau
Copy link
Contributor Author

jvonau commented Jul 26, 2021

I'm not clear on the relationship between iiab-install and iiab-complete.

I'm not sure why the ka-lite routines are here in the 'iiab' script and not the kalite role so that sort of muddles things up also.. I used iiab-complete as shorthand to signify that all available options (ansible, iiab-install, admin-console, kalite manage/content ) were run during the execution of the iiab script.

@holta
Copy link
Member

holta commented Jul 26, 2021

I'm not sure why the ka-lite routines are here in the 'iiab' script and not the kalite role

The reason is that downloading KA Lite's mandatory ~1GB en.zip language pack is far too time-consuming and fragile for people who don't have fast connections.

So roles/kalite is intentionally separated from this more fragile and time-consuming step (which happens near the very end of IIAB's install script).

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

Successfully merging this pull request may close these issues.

3 participants