LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-08-2004, 02:33 PM   #1
gendreau
LQ Newbie
 
Registered: May 2003
Posts: 24

Rep: Reputation: 15
running dhcpcd on boot


Hi,

For some reason I need to run dhcpcd from root every time I boot up linux. Internet will work fine after running this command. My question is, how can I automatically run this command from root when I log in as an account other than root?

Thanks.
 
Old 04-08-2004, 02:48 PM   #2
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
It really depends on your distro. However, there should already be a way to do this without having to do what I'm about to say, unless of course you are running LFS, in which case, you still ought to be aware of what I'm about to say

Somewhere in your /etc directory you should find a file called rc.local In Slackware this is /etc/rc.d/rc.local as well as a few other distros, I believe in Mandrake it's /etc/rc.local which is symlinked elsewhere, but that is fine. Either way, once you find this file, open it up in your favorite text editor and add the line:
/sbin/dhcpcd
assuming /sbin is the location where dhcpcd exists. If not, replace it with the directory where it lives, to find out type:
whereis dhcpcd
into a bash prompt.

Good Luck!

Cool
 
1 members found this post helpful.
Old 04-01-2012, 03:08 PM   #3
Theta13579
Member
 
Registered: Aug 2005
Location: Milky Way Galaxy
Distribution: Slackware
Posts: 34

Rep: Reputation: Disabled
Exclamation

Slackware 13.37 64bit with x86_multilibs default stock kernel: hardware and drivers are fine, Eth0 (built in) and Eth1 (pci slot) never conflicted.... no conflicts with firewall.

My system was perfect up to a few weeks ago the same thing happened... where I needed to log into root to run dhcpcd in order to receive the router ip address.
The only thing changed may have been an update or two: (but I'm not blaming Patrick)

I looked at the dmesg boot and it doesn't display the output from the boot process and finding the command that allows me to post what I see verbatim, as messages go by during boot hasn't been a fun command to find (nor have I had to use it before).
So apologies for being unable to show the boot output.

First I tried looking at all config scripts relevant to the grabbing the ip address... dhcpcd, dhclient, .... even added the required variables to the config information of Eth0 and Eth1 in /etc/rc.inet1.conf. looked at rc.local, rc.networkmanager and man paged a lot of stuff...

however your solution did fix the problem:
but it placed it at the end of the boot process just before you'd log in if it's set to go to command prompt. Now instead of scanning once, it's scanning for the IP address twice and after the fix it's scanning 3 times for dhcpcd throughout the boot process.


The first time it looks for the leased line, carrier gained, carrier lost, then it checks and scans for it a second time immediately after the first try... and says ip address (gained) abc.def.ghi.jkl. (obviously with numbers listed). Then it moves on to other processes to load.

I log in to windowed session and I still needed to log in to root, to dhcpcd to get online.

So by that account it seems dhcpcd looses the network information between scans... ?? and i think it said ...can't find routers ipv4ll ip address after the second scan.

I came across this thread and now it scans for the IP address three times but it scans for it as being the last process in the boot just before asking for a login: as I'd prefer it to grab and retain the ip address during the first time it scans.


any ideas other than a fresh install? or reinstall for all relevant scripts and config files?


Quote:
...
Somewhere in your /etc directory you should find a file called rc.local In Slackware this is /etc/rc.d/rc.local as well as a few other distros, I believe in Mandrake it's /etc/rc.local which is symlinked elsewhere, but that is fine. Either way, once you find this file, open it up in your favorite text editor and add the line:
/sbin/dhcpcd
assuming /sbin is the location where dhcpcd exists. If not, replace it with the directory where it lives, to find out type:
whereis dhcpcd
into a bash prompt.

Good Luck!

Cool

Last edited by Theta13579; 04-01-2012 at 03:29 PM.
 
  


Reply



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
Boot Delay DHCPCD Kelman Linux - Wireless Networking 5 10-13-2005 04:23 PM
Boot problems... dhcpcd? danthehat Linux - Software 0 08-03-2005 02:10 PM
/sbin/dhcpcd: not running - Slackware 10 jtp51 Slackware 6 10-14-2004 12:40 PM
dhcpcd at boot rgiggs Slackware 4 07-06-2004 11:49 AM
dhcpcd running b4 pcmcia stuff... hecresper Slackware 4 12-09-2002 07:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:49 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