LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   when eth0 cable disconnected, how's things in /etc/network/if-down.d invoked (https://www.linuxquestions.org/questions/linux-kernel-70/when-eth0-cable-disconnected-hows-things-in-etc-network-if-down-d-invoked-4175439858/)

5883 12-03-2012 04:00 PM

when eth0 cable disconnected, how's things in /etc/network/if-down.d invoked
 
when you disconnect eth0 cable,
driver will tell you eth0 is down.

things in /etc/network/if-down.d gets called very soon.

my question is, who tells system to run if-down.d ?

especially if i'm in the embedded world,
don't have the fancy stuff as network manager,
how can this be archived ?

thanks !

malekmustaq 12-04-2012 11:25 AM

Quote:

my question is, who tells system to run if-down.d ?
The init puts down as requested by the /etc/network script.
It is a script that automatically sets down the device upon detach of cable. If you hate that behaviour you may comment out (#) the ifconfig block that puts the device down; then removing the cable the device is still up.


Quote:

especially if i'm in the embedded world,
don't have the fancy stuff as network manager,
how can this be archived ?

From either another script:

Code:

/etc/network/if-up.d start {if it is there or something this kind is provided therein}
or from the terminal directly as root:

Code:

root-# ifconfig eth0 up
Hope that helps.

Good luck.

Skaperen 12-09-2012 09:06 PM

I suspect he wants to know in what way the knowledge of the interface status changes gets from the kernel to user space ... perhaps particularly if there are not userland programs like network manager or even udev taking care of this. So perhaps his question is if there is a kernel notification sent to userland (that can be registered for) or if something in userland must keep polling for the status changes.


All times are GMT -5. The time now is 05:18 AM.