Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: onelife on January 17, 2018, 09:40:05 AM

Title: Networking Restart without reboot
Post by: onelife on January 17, 2018, 09:40:05 AM
Hi there forum

I'm wanting to know how I can perform a true networking restart without a reboot.

At this stage running for example /opt/networking.sh or even restarting the udhcpc daemon doesn't do a full network restart.

By this I mean I still don't get a new IP address etc on DHCP. Only after a reboot do I get a new IP address or renewed IP / dns etc.

I'm thinking there must be a way to perform a full network restart - tables, routes, gateway, dns everything :)

Any ideas?

Thank you!
Title: Re: Networking Restart without reboot
Post by: curaga on January 17, 2018, 02:18:41 PM
From udhcpc --help: SIGUSR2 causes the IP to be released. So "sudo killall -USR2 udhcpc" would release the current IP, other steps may be needed after that.
Title: Re: Networking Restart without reboot
Post by: onelife on January 18, 2018, 02:11:26 AM
BIG thanks for that but yes, it seems this doesn't solve the issue :(

I think we almost need a /etc/init.d/networking restart type solution but not sure how todo that?

It seems that no matter what I do, only if you reboot the system do all aspects of networking get restarted.

I'd really love to be able todo the network refresh without a reboot as our system is designed to be powered up 24/7 without a reboot and it sees this is then when network timers or something get stuck in a loop and loose routes / dns / gateway or other info.

Any more ideas would be great :) - All without a reboot if possible as our application running on the system can't really have any downtime.

Thank you again and bye for now,
Title: Re: Networking Restart without reboot
Post by: aw on January 18, 2018, 08:44:18 AM
I published a set of scripts which can help with that:

  https://github.com/aw/tinycore-network

The network settings must be added to a .conf file, and then you simply run the /opt/network.sh script to reload everything. It uses something similar to what curaga suggested (kill -USR2).

It handles dhcp/static ipv4/ipv6, dns, default gateway, hostname, ntpserver.
Title: Re: Networking Restart without reboot
Post by: Juanito on January 18, 2018, 08:55:13 AM
was the network extension ever submitted to the repos?
Title: Re: Networking Restart without reboot
Post by: aw on January 18, 2018, 09:07:10 AM
No, I haven't submitted it.