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

net-online crashed at boot if network is not initialized #178

Closed
bell07 opened this issue Nov 3, 2017 · 8 comments
Closed

net-online crashed at boot if network is not initialized #178

bell07 opened this issue Nov 3, 2017 · 8 comments

Comments

@bell07
Copy link
Contributor

bell07 commented Nov 3, 2017

The rc.log contains the error message

net-online       |/etc/init.d/net-online: Zeile 59: read: Lesefehler: 0: Invalid argument
net-online       |/etc/init.d/net-online: Zeile 60: [: -eq: Einstelliger (unärer) Operator erwartet.
net-online       |/etc/init.d/net-online: Zeile 59: read: Lesefehler: 0: Invalid argument
net-online       |/etc/init.d/net-online: Zeile 60: [: down: Ganzzahliger Ausdruck erwartet.

Error message means the /sys/class/net/$dev does not exists in line 59 / 60

I added an if [ -e /sys/class/net/$dev ]; then around to solve the issue for me

@ghost ghost mentioned this issue Nov 21, 2017
@williamh
Copy link
Contributor

williamh commented Dec 5, 2017

@bell07 Which version of OpenRC are you using? On the current master branch, it doesn't look like the specific lines you mention are part of the issue.

@bell07
Copy link
Contributor Author

bell07 commented Dec 5, 2017

I am on funtoo's Version 0.23.2-r1
I see the line numbers does not match the code. Something automatically included at top?
The line 59 should be 47: read x < /sys/class/net/$dev/carrier. The device "$dev" (interfaces=) I set in /etc/conf.d/net-online because the auto-detection fails. At the get_interfaces() time the /sys/class/net/ is empty because the kernel did not initialized the card. The read fails for the same reason.
If the configured interface does not exist the report should wait for them. So it is possible to solve it by additional checi if /sys/class/net/$dev exists.
No idea how it can be solved if no device configured in conf.d and kernel is slow with detection :-(

@bell07
Copy link
Contributor Author

bell07 commented Dec 11, 2017

net-online       |/etc/init.d/net-online: Zeile 47: /sys/class/net/br0/carrier: No such file or directory
net-online       |/etc/init.d/net-online: Zeile 48: [: -eq: Einstelliger (unärer) Operator erwartet.

Still not solved. The /sys/class/net/br0 does not exists at early boot time

@williamh
Copy link
Contributor

I added a patch to the gentoo bug:

https://bugs.gentoo.org/attachment.cgi?id=509552

Can you apply that patch and let me know if it fixes your issue?

@bell07
Copy link
Contributor Author

bell07 commented Dec 11, 2017

Using the patch it is still
net-online |/etc/init.d/net-online: Zeile 50: [: -eq: Einstelliger (unärer) Operator erwartet.

Maybe use the " in [ "$carrier" -eq 1 ] ? Because carier is empty?

@bell07
Copy link
Contributor Author

bell07 commented Dec 11, 2017

The best way to reproduce the issue is to set interfaces="invalid" in /etc/conf.d/net-online
Expected result is the script wait for the invalid interface till time-out happens

williamh added a commit that referenced this issue Dec 11, 2017
@williamh
Copy link
Contributor

@bell07 Try the fix I just pushed and let me know if this solves the issue.

@bell07
Copy link
Contributor Author

bell07 commented Dec 12, 2017

Now the interface check works fine, thank you.

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

2 participants