Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Network Link Watcher
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  

Would you find this useful?
Yes
100%
 100%  [ 6 ]
No
0%
 0%  [ 0 ]
Already been done....
0%
 0%  [ 0 ]
Total Votes : 6

Author Message
mrtaz65
n00b
n00b


Joined: 18 Jul 2002
Posts: 5

PostPosted: Tue Jul 23, 2002 5:13 pm    Post subject: Network Link Watcher Reply with quote

OK,

I may have recreated something that already exists, but I couldn't find it :D

I am in the process of finishing a short app that is started as a service and monitors an ethernet port by using mii-tool every second (I could make this a config option I suppose) and determining if there is a link. If there previously was no link and now there is, it runs /etc/init.d/net.eth0 start. If there was a link and it went away, it runs /etc/init.d/net.eth0 stop.

I created an ugly init script to go in /etc/init.d so I was able to add it to the default runlevel. It is a python script and this is what it does:

On start - Check for PID and running process, if it exists, don't start. If it is not already running, check state of eth0. If eth0 has link, execute /etc/init.d/net.eth0 start.

Every second, check status of eth0.

Would anyone else like to look at this? It is pretty ugly right now, but it is working for me.

If there is something better, please let me know.

MrTaz65
Lenny Brown
mrtaz@tazman.com
Back to top
View user's profile Send private message
Scandium
Retired Dev
Retired Dev


Joined: 22 Apr 2002
Posts: 340
Location: Germany

PostPosted: Tue Jul 23, 2002 8:03 pm    Post subject: Reply with quote

I don't have a use for this but I voted "It is useful" because if someone else did it he doesn't have to use your app/script :)

Would be kind if you could post a link to the app you wrote !
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum