View Single Post

   
  #3 (permalink)  
Old 02-21-2008, 10:08 AM
David Latham
 
Posts: n/a
Default Re: Backgrounding a startup script

Alternatively there is info in the documentation about how to setup a dual
boot to the same Gentoo OS. I did this a while back and basically used a
different runlevel that did not bring up some services. You could create a
runlevel with all the same init.d scripts as default except for net.eth0.
All you do then is add the appropiate entry into Grub or Lilo and your'e
all set. You can then select the non network startup when youre not wired
in.

Dave L

Andreas Diendorfer wrote:

> Hi!
>
> Easy: Set the timeout of the DHCPD to a lower value.
>
> in /etc/conf.d/net
> iface_eth0="dhcp"
> dhcpcd_eth0="-t 10"
>
> this sets the timeout to 10 sec. mostly enough for the dhcpd server to
> respond.
>
> mfg, Andreas
>
> David wrote:
>> Using gentoo 2005.0 profile (with kernel 2.6.11.7) on a dell laptop with
>> an eth0 interface. When the laptop machine has an ethernet cable
>> plugged in it uses dhcpcd to get the ip and onto the net, but when it
>> does not the dhcpcd program times out (the default time is 1 min) so
>> when there's no ethernet cable I wait a minute or so on startup, while
>> dhcpcd is "looking" for the dhcp server
>>
>> The /etc/init.d/net.eth0 script looks like this:
>>
>> ebegin "Bringing ${IFACE} up via DHCP"
>> /sbin/dhcpcd ${dhcpcd_IFACE} ${IFACE} &
>> retval=$?
>> eend $retval
>> if [[ $retval == 0 ]]; then
>> # DHCP succeeded, show address retrieved
>>
>> I added the & at the end of the line which forks dhcpcd into the
>> background it. This is kind of an ugly hack; is there a way to fork, or
>> "background" the whole net.eth0 script? How do you guys with laptops
>> deal with this?
>>
>> TIA,
>> David


Reply With Quote