View previous topic :: View next topic |
Author |
Message |
Lochar n00b
Joined: 01 Oct 2003 Posts: 18
|
Posted: Tue Jan 18, 2005 2:03 am Post subject: Passing optional commands ...dhcpcd?[re: problems again] |
|
|
Hey, first of all I am completely (almost) new to Linux and Gentoo.
Still, I am very happy for what Ive got and how many new things
I have learnt from making a stage2 installation. Trial and error
I have a slight problem, due to rebooting alot (hoho ) I have noticed
that my adsl login host is puking due to dhcpcd is sending a 'logout' signal.
I would like to pass two arguments I found in the dhcpcd manual to the
init script that starts it:
Code: | man dhcpcd
....
-o Prevents dhcpcd from bringing interface down on exit.
-t <timeout>
Specifies (in seconds ) for how long dhcpcd will try to get an
IP address. The default is 60 seconds. ....
....
|
Atleast I hope that the argument "-o" is hinting towards what I want,
to not send 'logout signal' (release)
So I saw this in /etc/conf.d/net
Code: | snipplet from /etc/conf.d/net
# For DHCP set iface_eth? to "dhcp"
# For passing options to dhcpcd use dhcpcd_eth?
#
iface_eth0="dhcp"
#dhcpcd_eth0= ""
|
Ive been trying to change the dhcpcd_eth0 both to "-o" and to "-t 20" etc,
but it isnt working. Ive getting an error that says something about 'invalid
argument ... /some/path/rc - line 15'. (I havent found the way yet to get
the log the initialisation process, that would be a nice tip too if someone
know =) ) This error also happens for other services, seems like the
arguments gets passed along to the depcache too...? (also happens during
shutdown...)
I realise now, that it would be much better with a complete log of what
happens, but I dont know where to look and I dont want to reboot now that
I have a connection running.
Would be happy if someone has a tip =)
Thanks
Stefan _________________ Lochar
Last edited by Lochar on Wed Feb 02, 2005 9:34 pm; edited 2 times in total |
|
Back to top |
|
|
mayday147 l33t
Joined: 22 Mar 2004 Posts: 825 Location: Bucharest, Romania
|
Posted: Tue Jan 18, 2005 2:21 am Post subject: |
|
|
Isn't there a config file /etc/conf.d/dhcp or somth ? _________________ gentoo.ro |
|
Back to top |
|
|
gentoo_dude l33t
Joined: 08 May 2004 Posts: 645 Location: Washington, DC
|
Posted: Tue Jan 18, 2005 2:23 am Post subject: |
|
|
Why do you use dhcp for adsl connection? In order to have adsl running you need the following:
a. compile pppoe support in kernel plus ppp over serial and async hardware
For a 2.6 kernel
Code: | Device Drivers --> Networking Support
<*> PPP support
<*> PPP support for async serial ports
<*> PPP support for sync tty ports
< > PPP Deflate compression
< > PPP BSD-Compress compression
<*> PPP over Ethernet (EXPERIMENTAL) |
Then I think you already did this
Code: | USE="-X" emerge rp-pppoe |
Then run adsl configuration
Add rp-pppoe to runlevel default to start at boot
Code: | rc-update add rp-pppoe default |
Then you need to bring eth0 up at boot without dhcp
Code: | vi /etc/conf.d/net
iface_eth0="up", or give it a bogus IP (I use iface_eth0="0.0.0.0")
|
Add eth0 to start at boot also
Code: | rc-update add net.eth0 default |
Reboot, and your adsl connection should be up without any drops because of dhcp. |
|
Back to top |
|
|
Lochar n00b
Joined: 01 Oct 2003 Posts: 18
|
Posted: Tue Jan 18, 2005 2:33 am Post subject: |
|
|
We dont use a rp-pppoe client to login to our connection in Sweden . We get the ip-adress from dhcp, and then we login to the local gateway from a webpage (10.0.0.6/sd/init)
This is what I do from /etc/conf.d/local.start
Code: |
lynx -dump "http://10.0.0.6/sd/init" > /dev/null
lynx -dump "http://10.0.0.6/sd/login?username=USER&password=PASS" > /dev/null
|
change username for my user name
change password for my password
taken from: https://forums.gentoo.org/viewtopic.php?t=34019&highlight=adsl+login+telia
if someone can read swedish
It works as long as I get an IP-adress first from dhcpcd... _________________ Lochar |
|
Back to top |
|
|
Lochar n00b
Joined: 01 Oct 2003 Posts: 18
|
Posted: Tue Jan 18, 2005 3:06 am Post subject: |
|
|
This is what I get when I change /etc/conf.d/net to:
Code: |
iface_eth0="dhcp"
dhcpcd_eth0= "-o"
|
Quote: | /sbin/runscript.sh: line 15: -o: command not found |
I get the error when doing '/etc/init.d/net.eth0 stop' and after that
'/etc/init.d/net.eth0' start. This is the same error I get during boot, what
really tricks me is that it appears to happen during the start of other services,
shouldnt dhcpcd_eth0 be only for bringing up dhcpcd?
(edit: some formating ) _________________ Lochar |
|
Back to top |
|
|
Lochar n00b
Joined: 01 Oct 2003 Posts: 18
|
Posted: Tue Jan 18, 2005 8:42 pm Post subject: |
|
|
The errors I get: (my connection was down 1.5 hrs due to this today =( )
Code: |
/var/lib/init.d/depcache: line 15: -o command not found
/sbin/rc: line 15: -o command not found
|
Very annoying, and I have no clue what I am doing wrong. I have to start hard restarting everytime I need to boot I guess...
Is there a better dhcp client to use then dhcpcd?
Thanks
Stefan _________________ Lochar |
|
Back to top |
|
|
Sven Vermeulen Retired Dev
Joined: 29 Aug 2002 Posts: 1345 Location: Mechelen, Belgium
|
Posted: Tue Jan 18, 2005 8:50 pm Post subject: |
|
|
Lochar wrote: |
The errors I get: (my connection was down 1.5 hrs due to this today =( )
Code: |
/var/lib/init.d/depcache: line 15: -o command not found
/sbin/rc: line 15: -o command not found
|
|
Very strange, I use '-t 10' here and it works just fine. One example mentioned in this thread has a space between the '=' and the '"-o"', if that's the case, remove it and try again.
Could you also post the entire /etc/conf.d/net? There might be something messing things up elsewhere in the doc... |
|
Back to top |
|
|
Lochar n00b
Joined: 01 Oct 2003 Posts: 18
|
Posted: Tue Jan 18, 2005 9:13 pm Post subject: |
|
|
Thanks for the reply.
Regarding space in dhcpcd_eth0= "-o", I dont know if i copy/paste that or wrote it. Its a hot tip, will check as soon as I can...
Will also paste my complete net config when I get home...
/regards
Stefan _________________ Lochar |
|
Back to top |
|
|
Lochar n00b
Joined: 01 Oct 2003 Posts: 18
|
Posted: Tue Jan 18, 2005 11:42 pm Post subject: |
|
|
Solved, thanks a lot Sven,
Im unused with this types of scripts, and didnt have a clue that a simple
space can freak a script up.
Now we just have to see if the -o argument to dhcpcd solves my problem with
gateway pukage
Thanks a bunch
Stefan _________________ Lochar |
|
Back to top |
|
|
Lochar n00b
Joined: 01 Oct 2003 Posts: 18
|
Posted: Wed Feb 02, 2005 9:33 pm Post subject: |
|
|
Ok I will take up this topic again, dhcpcd is killing me.
So the little space solved the problem of passing an argument to dhcpcd up on initialisation, but for some weird reason it doesnt work anyway. Everytime I reboot, and shutdown sending dhcpcd a shutdown message, it bugs my connection and I cannot receive a new ip-adress for 10 minutes up to 2 hours, really frustrating!
here is my /etc/conf.d/net config file:
Code: |
# /etc/conf.d/net:
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.7 2002/11/18 19:39:22 azarah Exp $
# Global config file for net.* rc-scripts
# This is basically the ifconfig argument without the ifconfig $iface
#
iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"
#iface_eth1="207.170.82.202 broadcast 207.0.255.255 netmask 255.255.0.0"
# For DHCP set iface_eth? to "dhcp"
# For passing options to dhcpcd use dhcpcd_eth?
#
iface_eth0="dhcp"
dhcpcd_eth0="-o"
# For adding aliases to a interface
#
#alias_eth0="192.168.0.3 192.168.0.4"
# NB: The next is only used for aliases.
#
# To add a custom netmask/broadcast address to created aliases,
# uncomment and change accordingly. Leave commented to assign
# defaults for that interface.
#
#broadcast_eth0="192.168.0.255 192.168.0.255"
#netmask_eth0="255.255.255.0 255.255.255.0"
# For setting the default gateway
#
#gateway="eth0/192.168.0.1"
|
I have to manually kill dhcpcd everytime I am to reboot my system, if I want a network connection that works directly after boot.
Is there another way of receiving an ip-address, another dhcp client that I could use?
Anyone else encountered this?
(I will crosslink this to the scandinavian forum too, as perhaps some there have had the same problem)
Thanks in advance
Stefan _________________ Lochar |
|
Back to top |
|
|
megadonkey Apprentice
Joined: 24 Apr 2004 Posts: 224 Location: Bohuslän, Sweden
|
Posted: Thu Feb 03, 2005 2:47 am Post subject: |
|
|
Quote: | iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"
iface_eth0="dhcp"
dhcpcd_eth0="-o" |
Maybe the problem is that you're trying to have a static ip and dhcp running on the same card?
To which card is your modem connected?
change the config to the correct one.
(yes I know, a swede answering a swede in english...)
_________________ Life, loathe it or ignore it, you can't like it. |
|
Back to top |
|
|
Lochar n00b
Joined: 01 Oct 2003 Posts: 18
|
Posted: Thu Feb 03, 2005 8:39 am Post subject: |
|
|
omg!!
If thats true its so lame, how could I miss a stupid comment not being there. This is something I have to check asap. This isnt anything I have intended to be uncommented...
Thanks for pointing it out! _________________ Lochar |
|
Back to top |
|
|
Lochar n00b
Joined: 01 Oct 2003 Posts: 18
|
Posted: Fri Feb 11, 2005 3:36 am Post subject: |
|
|
/sigh
That was not the problem.
Could someone please point me in the right direction to adding a script that kills dhcpcd evertime I shutdown/reboot, before shutdown sequence sends the termination signal? Would be very much appreciated.
Ive given up to get this to work...
Either dhcpcd isnt compatible with my modem, ie it keeps restarting itself, or my gateway host (dhcp-server) isnt compatible how the dhcpcd client terminates my connection. (latter seems most reasonable) It seems I cant get the client to just do nothing and just end the process... _________________ Lochar |
|
Back to top |
|
|
|