# reattempt to bring network up

## rbv4531

I'm running Gentoo inside colinux with winpcap, and for some reason even though I've made the service dependent on my network card driver, the network isn't functional during the boot process.  I end up having to pull up the console, login as root, run "rc", and then the DHCP client does it's thing and ssh starts and everything is happy.

Rather than putting arbitrary timeouts in the boot process, I want to re-run rc automatically.  Could someone help me configure the following setup:

At boot, create a file, something like /var/services-starting

From cron, every 5 minutes run a script to check if the file exists.  If yes, run "rc".  When rc completes by starting all services, delete this file.

Does rc have a return code I can check to accomplish this?  There's no entry for rc in either man or info.

----------

## UberLord

What baselayout version?

----------

## trossachs

We've all be there before...  :Wink: 

----------

## rbv4531

[ebuild   R   ] sys-apps/baselayout-1.11.13  -bootstrap -build -static -unicode

----------

## UberLord

And what's the error during boot? Not your interpretation, just the error text  :Smile: 

----------

## rbv4531

```
 * Starting lo

 *   Bringing up lo ...                                                   [ ok ]

 * Initializing random number generator ...                               [ ok ]

INIT: Entering runlevel: 3

 * Starting metalog ...                                                   [ ok ]

 * Starting eth0

 *   Bringing up eth0

 *     dhcp

 *       Running dhcpcd ...

dhcpcd: MAC address = 40:00:00:00:10:00                                   [ !! ]

 * ERROR:  Problem starting needed services.

 *         "portmap" was not started.

 * ERROR:  Problem starting needed services.

 *         "famd" was not started.

 * ERROR:  Problem starting needed services.

 *         "netmount" was not started.

 * ERROR:  Problem starting needed services.

 *         "sshd" was not started.

 * Starting vixie-cron ...                                                [ ok ]

 * Starting local ...                                                     [ ok ]
```

----------

## rbv4531

```
colinux-penn ~ # rc

 * Starting eth0

 *   Bringing up eth0

 *     dhcp

 *       Running dhcpcd ...

dhcpcd: MAC address = 40:00:00:00:10:00

dhcpcd: your IP address = 192.168.8.20                                    [ ok ]

 *       eth0 received address 192.168.8.20

 * Starting portmap ...                                                   [ ok ]

 * Starting famd ...                                                      [ ok ]

 * Mounting network filesystems ...                                       [ ok ]

 * Starting sshd ...                                                      [ ok ]
```

----------

## rbv4531

```
/home/ben> dmesg

Linux version 2.6.11-co-0.7.1 (henry@sls-cd2p1) (gcc version 3.3.1 (mingw specia

l 20030804-1)) #1 Fri Jul 1 04:31:20 UTC 2005

256MB LOWMEM available.

On node 0 totalpages: 65536

  DMA zone: 0 pages, LIFO batch:1

  Normal zone: 65536 pages, LIFO batch:16

  HighMem zone: 0 pages, LIFO batch:1

Built 1 zonelists

Kernel command line: root=/dev/hdd3

Initializing CPU#0

Setting proxy interrupt vectors

PID hash table entries: 2048 (order: 11, 32768 bytes)

Using cooperative for high-res timesource

Console: colour CoCON 80x25

Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)

Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)

Memory: 255872k/262144k available (1540k kernel code, 0k reserved, 554k data, 10

8k init, 0k highmem)

Calibrating delay loop... 668.46 BogoMIPS (lpj=3342336)

Mount-cache hash table entries: 512 (order: 0, 4096 bytes)

CPU: After generic identify, caps: 0383fbff c1cbfbff 00000000 00000000 00000000

00000000 00000000

CPU: After vendor identify, caps: 0383fbff c1cbfbff 00000000 00000000 00000000 0

0000000 00000000

CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)

CPU: L2 Cache: 256K (64 bytes/line)

CPU: After all inits, caps: 0383fbff c1cbfbff 00000000 00000020 00000000 0000000

0 00000000

CPU: AMD Athlon(tm) MP 1800+ stepping 02

Enabling fast FPU save and restore... done.

Enabling unmasked SIMD FPU exception support... done.

Checking 'hlt' instruction... OK.

NET: Registered protocol family 16

devfs: 2004-01-31 Richard Gooch (rgooch@atnf.csiro.au)

devfs: boot_options: 0x0

cofuse init 0.1 (API version 2.2)

Initializing Cryptographic API

serio: cokbd at irq 1

io scheduler noop registered

io scheduler anticipatory registered

io scheduler deadline registered

io scheduler cfq registered

RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize

cobd: loaded (max 32 devices)

alias for cobd0 is hdd3

cobd alias cobd0 -> hdd3 created

alias for cobd1 is hdd2

cobd alias cobd1 -> hdd2 created

loop: loaded (max 8 devices)

conet: loaded (max 16 devices)

conet0: initialized

mice: PS/2 mouse device common for all mice

input: AT Translated Set 2 keyboard on cokbd

NET: Registered protocol family 2

IP: routing cache hash table of 2048 buckets, 16Kbytes

TCP established hash table entries: 16384 (order: 5, 131072 bytes)

TCP bind hash table entries: 16384 (order: 4, 65536 bytes)

TCP: Hash tables configured (established 16384 bind 16384)

NET: Registered protocol family 1

NET: Registered protocol family 17

ReiserFS: hdd3: found reiserfs format "3.6" with standard journal

ReiserFS: hdd3: using ordered data mode

ReiserFS: hdd3: journal params: device hdd3, size 8192, journal first block 18,

max trans len 1024, max batch 900, max commit age 30, max trans age 30

ReiserFS: hdd3: checking transaction log (hdd3)

ReiserFS: hdd3: Using r5 hash to sort names

VFS: Mounted root (reiserfs filesystem).

Freeing unused kernel memory: 108k freed

Adding 977248k swap on /dev/hdd2.  Priority:-1 extents:1
```

----------

## rbv4531

tail of colinux stdout/stderr log

```
PID: 1164

executing: colinux-bridged-net-daemon -c 1164 -i 0 -n "Gigabit" -mac 40:00:00:00

:10:00

colinux: booting

colinux: Linux VM terminated

colinux: powered off, exiting.

Cooperative Linux Daemon, 0.7.1

Compiled on Fri Jul  1 04:39:10 2005

using 'vmlinux' as kernel image

configuring 256 MB of virtual RAM

selected cobd0 for hdd3, mapping to '\Device\Harddisk0\Partition3'

selected cobd1 for hdd2, mapping to '\Device\Harddisk0\Partition2'

configured PCAP bridge at 'Gigabit' device as eth0

MAC address: 40:00:00:00:10:00

kernel boot parameters: 'root=/dev/hdd3'

PID: 1152

executing: colinux-bridged-net-daemon -c 1152 -i 0 -n "Gigabit" -mac 40:00:00:00

:10:00

colinux: booting

colinux: Linux VM terminated

colinux: powered off, exiting.

Cooperative Linux Daemon, 0.7.1

Compiled on Fri Jul  1 04:39:10 2005

using 'vmlinux' as kernel image

configuring 256 MB of virtual RAM

selected cobd0 for hdd3, mapping to '\Device\Harddisk0\Partition3'

selected cobd1 for hdd2, mapping to '\Device\Harddisk0\Partition2'

configured PCAP bridge at 'Gigabit' device as eth0

MAC address: 40:00:00:00:10:00

kernel boot parameters: 'root=/dev/hdd3'

PID: 1204

executing: colinux-bridged-net-daemon -c 1204 -i 0 -n "Gigabit" -mac 40:00:00:00

:10:00

colinux: booting

colinux: Linux VM terminated

colinux: powered off, exiting.
```

----------

## rbv4531

Everything works if I start the colinux service after Windows finishing starting.  But a restart of the service is not necessary, the network starts working even within the running session, just not in time for dhcpcd.

----------

## UberLord

Try emerging dhcpcd-2.0.0 and put this in /etc/conf.d/net

```
dhcpcd_eth0="-t 0"
```

As that should force dhcp to wait for an infinite ammount of time until it gets an IP address

----------

## rbv4531

Already got it:  [ebuild   R   ] net-misc/dhcpcd-2.0.0  -build -debug -static 0 kB

But, will the "-t 0" cause it to retry, or just wait for a response?  I'll try it anyway.  First I'm going to increase the timeout to 30 seconds (I'd reduced it to 1 because it never takes much time at all for the router to reply, when everything is connected)

----------

## rbv4531

I eventually made it work by adding a preup function which calls sleep 30

This is still less than ideal...

----------

