WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Networking Restart without reboot  (Read 4582 times)

Offline onelife

  • Full Member
  • ***
  • Posts: 141
Networking Restart without reboot
« 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!

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11048
Re: Networking Restart without reboot
« Reply #1 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.
The only barriers that can stop you are the ones you create yourself.

Offline onelife

  • Full Member
  • ***
  • Posts: 141
Re: Networking Restart without reboot
« Reply #2 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,

Offline aw

  • Newbie
  • *
  • Posts: 45
Re: Networking Restart without reboot
« Reply #3 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.
github.com/aw

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14826
Re: Networking Restart without reboot
« Reply #4 on: January 18, 2018, 08:55:13 AM »
was the network extension ever submitted to the repos?

Offline aw

  • Newbie
  • *
  • Posts: 45
Re: Networking Restart without reboot
« Reply #5 on: January 18, 2018, 09:07:10 AM »
No, I haven't submitted it.
github.com/aw