LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   dhcpcd being started twice on boot (https://www.linuxquestions.org/questions/slackware-14/dhcpcd-being-started-twice-on-boot-143530/)

Wynd 02-07-2004 10:20 PM

dhcpcd being started twice on boot
 
Recently I upgraded to slackware-current using swaret. Now, whenever I boot up, there are two instances of dhcpcd trying to configure my eth0. If I want to be able to access the internet, I have to killall dhcpcd and re-run rc.inet1. I have looked in the /etc/rc.d directory and I can't find anything that would cause this. Is there something I'm overlooking?

slackwarefan 02-07-2004 10:23 PM

did you look at /etc/rc.d/rc.S speicifly?

Wynd 02-07-2004 10:33 PM

Yep, and rc.inet1. The only dhcpcd statements I can find in /etc/rc.d are in rc.0 and rc.6 which kill it, and rc.inet1 that starts it (once) for eth0.

slackwarefan 02-07-2004 11:00 PM

Did you cat both of them and check them with grep?

Wynd 02-07-2004 11:08 PM

Code:

[pete@l0s2 rc.d]$ grep dhcp *
rc.0:# Try to kill dhcpcd so the DHCP leases can be returned:
rc.0:killall -15 dhcpcd 1> /dev/null 2> /dev/null
rc.6:# Try to kill dhcpcd so the DHCP leases can be returned:
rc.6:killall -15 dhcpcd 1> /dev/null 2> /dev/null
rc.firewall:# This may help if you have a dynamic IP address \(e.g. slip, ppp, dhcp\).
rc.inet1:  /sbin/dhcpcd -t 10 ${DHCP_HOSTNAME} -d eth0
rc.inet1:  /sbin/dhcpcd -t 10 ${DHCP_HOSTNAME2} -d eth1
rc.S:  /var/run/ppp* /etc/dhcpc/dhcpcd-eth0.pid /etc/forcefsck /etc/fastboot
[pete@l0s2 rc.d]$

The rc.S line is the continuation of some line deleting temporary files at boot.

maciek 11-12-2004 03:56 PM

.
 
well i have the same problem, and no idea how to solve it, cat /var/log/messages gives this:
Code:

Nov 12 22:16:33 maciek kernel: ACPI: PCI interrupt 0000:00:06.0[A] -> GSI 10 (level, low) -> IRQ 10
Nov 12 22:16:33 maciek kernel: eth0: RealTek RTL8139 at 0xe0cdcf00, 00:02:44:67:56:7f, IRQ 10
Nov 12 22:16:33 maciek kernel: ACPI: PCI interrupt 0000:00:0b.0[A] -> GSI 5 (level, low) -> IRQ 5
Nov 12 22:16:33 maciek kernel: eth1: RealTek RTL8139 at 0xe0cf1e00, 00:40:f4:9d:0e:b2, IRQ 5
Nov 12 22:16:33 maciek logger: /etc/rc.d/rc.inet1:  /sbin/ifconfig eth0 192.168.0.1 broadcast 192.168.0.7 netmask 255.255.255.248
Nov 12 22:16:33 maciek logger: /etc/rc.d/rc.inet1:  /sbin/dhcpcd -d -t 10 eth1
Nov 12 22:16:33 maciek kernel: eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
Nov 12 22:16:33 maciek kernel: agpgart: Detected VIA KT266/KY266x/KT333 chipset
Nov 12 22:16:33 maciek kernel: agpgart: Maximum main memory to use for agp memory: 439M
Nov 12 22:16:33 maciek kernel: agpgart: AGP aperture is 128M @ 0xe0000000
Nov 12 22:16:33 maciek kernel: eth1: link up, 100Mbps, full-duplex, lpa 0x45E1
Nov 12 22:16:33 maciek logger: /etc/rc.d/rc.inet1:  /sbin/ifconfig eth0 192.168.0.1 broadcast 192.168.0.7 netmask 255.255.255.248
Nov 12 22:16:33 maciek logger: /etc/rc.d/rc.inet1:  /sbin/dhcpcd -d -t 10 eth1
Nov 12 22:16:36 maciek logger: /etc/rc.d/rc.hotplug start (exiting script)

i've been checking rc.M, but there is only one call to rc.inet1, however from logs it seems that it is called twice

tobyl 11-13-2004 08:47 AM

On my system I get

/etc/rc.d/rc.inet1: eth0 is already up, skipping

in /var/log/messages, but I have never really thought about it as it didn't cause a problem.

I found that there is a file /etc/hotplug/net.agent
to be honest I dont know really what this file is about, but it contains the section

# Slackware Linux:
if [ -x /etc/rc.d/rc.inet1 ]; then
# Interface already up? If so, skip.
if ! /sbin/ifconfig | grep "^${INTERFACE} " 1> /dev/null ; then
debug_mesg run rc.inet1
exec /etc/rc.d/rc.inet1
fi

could this be where it is getting called from?

you could try making net.agent non executable and testing with a reboot
-I haven't researched this very thoroughly, but it wouldn't hurt to try-

tobyl

maciek 11-13-2004 12:47 PM

.
 
ok the simplest solution will be to move the section
Code:

if [ -x /etc/rc.d/rc.inet1 ]; then
  . /etc/rc.d/rc.inet1
fi

in rc.M just after the hotplug section
as hotplug loads all kernel modules, and then you may comment out section in net.agent, that tobyl mentioned
Code:

# Slackware Linux:
#if [ -x /etc/rc.d/rc.inet1 ]; then
# Interface already up? If so, skip.
#if ! /sbin/ifconfig | grep "^${INTERFACE} " 1> /dev/null ; then
#debug_mesg run rc.inet1
#exec /etc/rc.d/rc.inet1
#fi

as for now this is the only solution i came up with


All times are GMT -5. The time now is 01:57 AM.