Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Introduce a pause between interface up and dhcpcd
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
sdfg
Apprentice
Apprentice


Joined: 11 Feb 2005
Posts: 200

PostPosted: Thu Aug 16, 2012 7:28 pm    Post subject: Introduce a pause between interface up and dhcpcd Reply with quote

Pretty much as the subject, I need to introduce a pause between an interface coming up, and dhcpcd doing its thing. I've tried creating a dhcpcd hook for both CARRIER and PREINIT with 'sleep 5' in them, which /are/ getting called, but it's not helping.

I'm setting a manual mac address for tap devices on my openvpn, the problem is that openvpn brings the tap device up first and /then/ applies the hw address. But as soon as the interface comes up, dhcpcd jumps on it and goes 'mine!', and the attempt to set the hw address fails because the device is in use.

The only two things I can think of that the hooks aren't working is either:

a) the second PREINIT is called, dhcpcd has claimed the device already , so no matter how long a sleep I set, the device is busy, or

b) the hooks are run when dhcpcd simply reports what's going on, as opposed to the hooks having any control over the dhcpcd process. So yeah, there's /something/ sleeping for 5 seconds, but dhcpcd doesn't care, and just trundles on doing it's thing and shouting about what it's doing, and letting everything else do what it wants depending on what it shouts.

Anyone got any clues? Or any other means of putting a pause in there to give openvpn a chance to add the hw address?

-K
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1631
Location: United Kingdom

PostPosted: Thu Aug 16, 2012 11:33 pm    Post subject: Reply with quote

If you were using NetworkManager, I wonder if you could use NetworkManagerDispatcher to kick off dhcpcd only when the network connection comes up (somewhat similar to how NetworkManagerDispatcher is used as explained in the post Synchronise your Gentoo Linux clock with an Internet time server).
_________________
Clevo W230SS: amd64 OpenRC elogind nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 OpenRC elogind xf86-video-ati. Dual boot Win 7 Pro 64-bit.
KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
BillWho
Veteran
Veteran


Joined: 03 Mar 2012
Posts: 1600
Location: US

PostPosted: Fri Aug 17, 2012 1:29 pm    Post subject: Reply with quote

Kasyx,

Did you try a service dependency in /etc/rc.conf :?:
_________________
Good luck :wink:

Since installing gentoo, my life has become one long emerge :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security 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