Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello,
Thank you so much for your reply.
I bring down a NIC and bring it up again, but the v2ray service didn't work until I restart the network service.
I'm not familiar with v2ray, but likely once it sees there's no network to use it drops off. Restarting the network likely restarts all services that depend on it. This would be up to your init system. Personally, I don't see the reason to stop the network itself unless it's shutdown time for the machine.
I'm not familiar with v2ray, but likely once it sees there's no network to use it drops off. Restarting the network likely restarts all services that depend on it. This would be up to your init system. Personally, I don't see the reason to stop the network itself unless it's shutdown time for the machine.
Hello,
Thank you so much for your reply.
Do you think the same might happen to other services like Apache?
Basically, restarting the Network svc is usually a last resort (unless you're shutting down / rebooting the box).
Attempt to fix whatever svc is having an issue, inc restarting the svc if needed.
Ofc any svc that is network dependent is going to fail if you yank the network out from under it.. unless it's a very quick restart, in which case it might(!) be able to recover.
However, that's a case-by-case thing.
Another thing to consider, especially if using dhcp
There are times when taking a network interface down and back up may give it a new IP.
Any service that has an active connection at the time the card is taken down will have that connection broken by taking the interface down.
Bringing it back up does not restore those connections The service is left with a connection that was interrupted and is waiting for the other end to reply or respond but there is no longer a complete connection so it hangs.
This is just the way services that use tcp work -- an active connection that is broken remains broken -- so if you have need to disable the network you should first stop all services that use the network.
Another thing to consider, especially if using dhcp
There are times when taking a network interface down and back up may give it a new IP.
Any service that has an active connection at the time the card is taken down will have that connection broken by taking the interface down.
Bringing it back up does not restore those connections The service is left with a connection that was interrupted and is waiting for the other end to reply or respond but there is no longer a complete connection so it hangs.
This is just the way services that use tcp work -- an active connection that is broken remains broken -- so if you have need to disable the network you should first stop all services that use the network.
Hello,
Thank you so much for your reply.
So if we stop the Apache service and run it again, then people have to refresh the website!
How about the UDP protocol?
Hello,
Thank you so much for your reply.
So if we stop the Apache service and run it again, then people have to refresh the website!
How about the UDP protocol?
If you bring down the network interface they have to reconnect.
If you stop apache and restart it they have to reconnect.
Both those are from the client end.
From the server end:
If apache has an active connection it may stall when the interface is removed but does not stall when it is stopped and restarted.
Rebooting a system brings services down in an orderly manner and restarts them the same way.
Downing a network interface while the service is running is a sudden disorderly disconnect and can have unanticipated results.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.