LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-25-2004, 04:42 PM   #1
blk96gt
Member
 
Registered: Jun 2004
Location: Nacogdoches, TX
Distribution: Ubuntu 7.04
Posts: 230

Rep: Reputation: 30
dhcp won't start automatically on boot


For some odd reason, dhcpcd won't start up automatically anymore. This computer is being used as a server, and I set it up at my house and dhcp started just fine. But, when I set it up where I'm keeping it, I noticed that it wasn't starting on its own. I tried adding a line in rc.local with the command to start eth0(/sbin/dhcpcd eth0), but it seems like it would only try for about 2 seconds or so and then the login prompt would come up. When I start it manually it takes a little while to get the ip address. If this was my desktop computer I wouldn't mind, but since this is being used as a server, and also doesn't have a keyboard, mouse, and monitor hooked up to it, I would like to figure out a way to fix this in cause I have to resart or the power goes out. Any help would be appreciated.
 
Old 10-25-2004, 05:17 PM   #2
philipacamaniac
Member
 
Registered: Oct 2003
Distribution: Slackware 10, Slackware-current, Slax
Posts: 50

Rep: Reputation: 15
dhcpcd should be starting from /etc/rc.d/rc.inet1, so take a look in there, and also make sure that file has execute privileges (if not then run /bin/chmod 755 /etc/rc.d/rc.inet1).

Check the configuration file. In /etc/rc.d/rc.inet1.conf, you should have a section that looks like this:
Code:
# Config information for eth0:
IPADDR[0]=""
NETMASK[0]=""
USE_DHCP[0]="yes"
DHCP_HOSTNAME[0]=""
On that note... shouldn't a server have a static IP so you can forward packets from your gateway/router?
 
Old 10-25-2004, 06:49 PM   #3
rotvogel
Member
 
Registered: Oct 2003
Posts: 534

Rep: Reputation: 30
I use a little script which I run in cron every 5 minutes. Here it is:
Code:
#!/bin/sh
#
# dhcp-check - checks status of dhcp client
# in this case dhcpcd with a pid in /etc/dhcpc
# and restarts it when it is not running
#
if [ -f /etc/dhcpc/dhcpcd-eth0.pid ]; then
    echo DHCP client is running already...
else
    /sbin/dhcpcd -t 30 -d eth0 && /etc/rc.d/rc.firewall restart
fi
Note: this one is for eth0, if you use another external device please adjust every instance of eth0 to the device you're using. The -t 30 is an extended period for timing out on dhcp response. Slackware uses default 10 (secs) . I restart my firewall script after successfully (re)starting the dhcpcd daemon. If you do not want that you can leave it out ( delete the && /etc/rc.d/rc.firewall restart part)
 
Old 10-25-2004, 06:54 PM   #4
blk96gt
Member
 
Registered: Jun 2004
Location: Nacogdoches, TX
Distribution: Ubuntu 7.04
Posts: 230

Original Poster
Rep: Reputation: 30
Thanks rotvogel I didn't even thinking about making a script to run in cron.

philipacamaniac:
Everything in the rc.inet1 and rc.inet1.conf file are fine. As I said, it worked before I turned it off and brought it over to my gf's to set it up. And this server isn't behind a router/gateway, it's on a school network, so it's directly connected to the internet.
 
Old 01-23-2005, 06:43 PM   #5
phoenix99
Member
 
Registered: Jun 2004
Location: Canada
Distribution: Slackware 10.2 KDE 3.4
Posts: 43

Rep: Reputation: 15
I've the same kind of problem.. but i dont know why.. before I add module to my 2.6.10 kernel, it's worked fine...
now when i boot in Slackware10 (current) dhcpcd is started (when i do a ps -aux) but i dont get any IP from my dhcp server. i must manualy do a /etc/rc.d/rc.inet1 stop and /etc/rc.d/rc.inet1 start
after it's work fine...

Anyone have an idead what i can do to fix it.. (if possible not a script... ) thanks !
 
Old 01-24-2005, 01:42 PM   #6
phase9
Member
 
Registered: Mar 2004
Location: austria, vienna
Distribution: slackware-10.2
Posts: 89

Rep: Reputation: 15
Hi!

Maybe increasing the timeout would help dhcpcd to get an ip address.

Look for the following lines in /etc/rc.d/rc.inet1 and change `-t 10' to e.g. `-t 30'.

Code:
/sbin/dhcpcd -d -t 30 -h ${DHCP_HOSTNAME[$1]} eth${1}

/sbin/dhcpcd -d -t 30 eth${1}
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I start dhclient automatically at boot-up? moonmoth Linux - Networking 4 07-17-2005 04:15 AM
How can mySQL start automatically on boot ? John_Emad Linux - Software 6 06-24-2005 12:33 PM
How do I start a program automatically when I boot up? bad_andy Mandriva 2 11-27-2004 08:15 PM
How do I start programs automatically with boot up? Kasperisa Linux - Newbie 6 07-15-2004 03:29 PM
How to start programs automatically at boot? onchiman Linux - Hardware 2 03-18-2003 10:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration