# dhcpcd problems

## darkphader

Getting this in the logs:

```
dhcpcd[11267]: dhcpConfig: fopen: No such file or directory
```

There is no indication exactly what file or directory it can't find. I have unmerged and remerged dhcpcd on this particular system yet the problem remains.

Usually after the above message there is this one:

```
dhcpcd[7526]: terminating on signal 11
```

Then the client has to reboot the system in order to get the network working again (I'm reasonably certain they could just restart the network but that's out of their comfort zone).

Any clues?

Chris

----------

## darkphader

Because of the dhcpcd client crashing on every renewal:

```
dhcpcd[11267]: dhcpConfig: fopen: No such file or directory

dhcpcd[7526]: terminating on signal 11
```

I unmerged dhcpcd, and then manually deleted any remaining files and directories associated with it.

I then remerged dhcpcd and also remerged baselayout in cae it was supplying anything for dhcpcd.

The crashes stopped but dhcpcd still logged:

```
dhcpcd[11267]: dhcpConfig: fopen: No such file or directory
```

 at every renewal interval. Comparing another system I noticed the empty directory /etc/dhcpc that was not on the problem system. After a 

```
mkdir /etc/dhcpc
```

 the log errors on renewal seem to have stopped.

An 

```
equery b /etc/dhcpc
```

 returns nothing, so the question now is what package installs or creates the "/etc/dhcpc" directory?

Chris

----------

## UberLord

Interesting. Does dhcpcd put anything in /etc/dhcpc after renewing? What version of dhcpcd and baselayout do you have installed?

----------

## darkphader

I was wrong about the log errors, they are still there. I was fooled when I didn't see one after the renewal but it was only because the write to the log was delayed. So I'm guessing the existence or not of /etc/dhcpc has little to do with the problem, and that maybe that directory is left over from an older version. As for the directory /etc/dhcpc their is nothing in it (even on a system that logs no such errors).

Versions are baselayout-1.12.0_pre16-r3 and currently dhcpcd-2.0.3. Dhcpcd was at 2.0.2 when I killed the process and deleted all the related files I could find and unmerged it. I then remerged sys-apps/baselayout-1.12.0_pre16-r3 followed by a remerge of dhcpcd-2.0.2 (it was in distfiles), when the network was brought back up I upgraded to dhcpcd-2.0.3.

I don't think the problems were initially due to faults with dhcpcd as the client's hard drive was heading south, although most of the damage appeared relegated to the /home partition. I was able to move virtually everything to a new disk (using mostly tar, rsync for /home), with a few exceptions being some files from /home. When dhcpcd crashed after the move to the new disk I thought that maybe it or some of its related files had suffered some damage previous to the move and so decided on the above tactic.

AFAIK, the network has not gone since the above rebuilding but the error still gets logged at every renewal time:

```
Mar 24 17:43:01 sugarkane dhcpcd[11267]: dhcpConfig: fopen: No such file or directory

Mar 24 23:43:02 sugarkane dhcpcd[11267]: dhcpConfig: fopen: No such file or directory

Mar 25 05:43:03 sugarkane dhcpcd[11267]: dhcpConfig: fopen: No such file or directory

Mar 25 11:43:04 sugarkane dhcpcd[11267]: dhcpConfig: fopen: No such file or directory

Mar 26 00:19:36 sugarkane dhcpcd[7280]: dhcpConfig: fopen: No such file or directory

Mar 26 06:19:37 sugarkane dhcpcd[7280]: dhcpConfig: fopen: No such file or directory
```

 And that doesn't happen with any of the other systems I work with.

Thanks.

Chris

----------

## darkphader

Is there any way to find out what file dhcpcd is trying to open?

----------

## UberLord

After checking the source, it's trying to open /etc/{resolv,ntp,yp}.conf or the host info file in /var/lib/dhcpc-$iface.{cache,info}

The next version of dhcpcd will state which file is causing the error. In the mean time, check that those files do exist and that they are writeable.

Are you running SELinux by any chance?

----------

## darkphader

Not running SELinux.

All files appear correct, with identical privileges on both a working system and on the error logging system.

Chris

----------

## UberLord

Also, check /var/lib/net-scripts/state/$iface directory exists.

Try checking out our current svn repo

http://developer.berlios.de/svn/?group_id=4229

Then do a configure and make and then copy dhcpcd to /sbin and try again. That version will tell you the exact file it's having a problem with.

----------

## darkphader

 *UberLord wrote:*   

> Also, check /var/lib/net-scripts/state/$iface directory exists.

 

There's a difference between the two systems, the one logging the errors does not have the eth0 directory, only lo. I manually created the directory and will keep an eye on the logs. Do you what app is responsible for creating that directory? I may need to do some other cleanup work.

Thanks again.

Chris

----------

## UberLord

baselayout-1.12 is resposible for it, but the next release we're dropping that idea and going with a gentooified resolvconf instead.

In the meantime, you could try commenting out line 14 in /lib/rcscripts/net.modules.d/helpers.d/dhcp-state and see if that helps any.

----------

## darkphader

I noticed that bootmisc cleans out /var/lib/net-scripts/state when booting, so I remerged baselayout and dhcdpd and rebooted, when the system came back up it there was a /var/lib/net-scripts/state/eth0 directory.

I'll keep an eye on it for a couple of days and post if anything interesting comes up.

[EDIT] Also did an rc-update del/add of net.eth0 at that time (just in case).

Thanks.

Chris

----------

## darkphader

Hmm.../var/lib/net-scripts/state/eth0 has gone missing, it was there earlier today (BTW all of 'system' was remerged last night and the system was rebooted), and now it is gone, /var/lib/net-scripts/state/lo is still there, the network is currently still running. I saw this happen previously and was hoping that I was either hallucinating or that the above would have fixed it.

Chris

----------

## darkphader

Followup from above post -  the open errors are back:

```
Mar 28 21:31:56 sugarkane dhcpcd[7288]: dhcpConfig: fopen: No such file or directory

Mar 29 03:31:57 sugarkane dhcpcd[7288]: dhcpConfig: fopen: No such file or directory

Mar 29 09:31:58 sugarkane dhcpcd[7288]: dhcpConfig: fopen: No such file or directory

```

However, at least the system isn't losing network connectivity. I wonder what is deleting that /var/lib/net-scripts/state/eth0 directory. Is it possibly dhcpcd itself?

As an aside, I should note that the problem system uses -Os, while the non-problem system uses -O2. Other than that the compilation options are identical.

Chris

----------

## UberLord

 *UberLord wrote:*   

> In the meantime, you could try commenting out line 14 in /lib/rcscripts/net.modules.d/helpers.d/dhcp-state and see if that helps any.

 

Have you tried that?

----------

## darkphader

 *UberLord wrote:*   

> Have you tried that?

 

No, I haven't tried that yet. Line 14 is the start of an "if ...", I would need to comment out all of the lines to the "fi" for that section, correct?

----------

## UberLord

Try line 16 or the line that says

```
remove_state "${interface}"
```

----------

