Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Problem starting ssh after installing new wifi card...
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
cgmd
Veteran
Veteran


Joined: 17 Feb 2005
Posts: 1585
Location: Louisiana

PostPosted: Tue Apr 04, 2006 6:47 pm    Post subject: Problem starting ssh after installing new wifi card... Reply with quote

Hi, All...

Since changing to a new wifi card, which uses madwifi driver (ath0), I am unable to start ssh:
Code:
 cgmd # /etc/init.d/sshd restart
 * Starting eth0               
 *   Bringing up eth0           
 *     dhcp                     
 *       Running dhcpcd ...                                                                                     [ !! ]
 * ERROR:  Problem starting needed services.
 *         "sshd" was not started.


Does anyone have a suggestion as to how I can correct this?

Thanks...
_________________
"Primum non nocere" ---Galen
Back to top
View user's profile Send private message
erik258
Advocate
Advocate


Joined: 12 Apr 2005
Posts: 2650
Location: Twin Cities, Minnesota, USA

PostPosted: Tue Apr 04, 2006 7:11 pm    Post subject: this field is hard to fill usefully Reply with quote

from /etc/init.d/sshd
Quote:
depend() {
use logger dns
need net
}


it looks like its trying to bring up eth0 first. if your ath0 driver installation is like mine, you migh have difficulty editing your /etc/conf.d/net to correct the problem. in fact, the whole ath0 installation is kind of wierd. for example, my modules are automatically modprobe'd; they aren't in /etc/modules.autoload.d/kernel-2.6 where they should be. I don't know why they start at boot. I think they're probably loaded by the pcmcia stuff since they seem to be loaded directly thereafter in dmesg.

As a hackish solution, I just put
Quote:
dhcpcd ath0;
sshd;

in my /etc/conf.d/local.start which works ok for me.

if you want the proper fix it probably wouldn't be hard to figure it out ... i think an /etc/init.d/net.ath0 file or something similar would help. Also /etc/conf.d/net probably would need to be edited. I tried to add the line iface_ath0="dhcp" in my /etc/conf.d/net but it didn't take. notice that /etc/conf.d/net isn't a runscript in itself; there is a /etc/init.d/net.eth0 though, and I think an anolgue of that, /etc/init.d/net.ath0 would be the solution.
Back to top
View user's profile Send private message
erik258
Advocate
Advocate


Joined: 12 Apr 2005
Posts: 2650
Location: Twin Cities, Minnesota, USA

PostPosted: Tue Apr 04, 2006 7:22 pm    Post subject: I think this is actually how one might do it. Reply with quote

so here's my question: what does init.d/net.ath0 need to do? Of course the actual answer to that question is complicated ; that doesn't really matter because the exact answer is already written in /etc/init.d/net.eth0.
so I simply
Quote:
lappy init.d # /etc/init.d/net.eth0 restart
* Please make sure that /etc/conf.d/net has $ifconfig_eth0 set
* (or $iface_eth0 for old-style configuration)

and as you can see that doesn't work given
Quote:
#iface_eth0="192.168.0.3 broadcast 192.168.0.255 netmask 255.255.255.0"
#dhcpcd_eth0="..."
#alias_eth0="192.168.0.3 192.168.0.4"
#broadcast_eth0="192.168.0.255 192.168.0.255"
#netmask_eth0="255.255.255.0 255.255.255.0"
eth0 isn't mentioned in /etc/conf.d/net.

so I say
Quote:
ln -s /etc/init.d/net.eth0 /etc/init.d/net.ath0


and
Quote:
lappy init.d # /etc/init.d/net.ath0 restart
* Re-caching dependency info (mtimes differ)...
* Keeping kernel configuration for ath0

how do you like that? now i looked through /etc/init.d/net.eth0 before i did this and if it wouldn't have kept kernel configuration (that is if the device wasn't already UP) it would have started up ath0 just like we wanted to. there you go, your real fix that you haven't yet requested. ; )

of course, afterwords you'd want to
Code:
 rc-update add net.ath0 default
so it starts up every time. unless you don't want it unless /etc/init.d/sshd is also started, because it would probably load it anyway as a dependancy.
It would also be wise, if rc-update show | grep eth0, to [/code]rc-update del net.eth0 `rc-update show | awk 'BEGIN {OFS=""; FS="|"; } /eth0/ {print $2; }'` . i don't think that awk command will actually work, by the way.
Quote:
lappy init.d # rc-update del ath0 `rc-update show | awk 'BEGIN {OFS=""; FS="|"; } /ath0/ {print $2; }'`
* ath0 not found in any of the specified runlevels.
Back to top
View user's profile Send private message
Maedhros
Bodhisattva
Bodhisattva


Joined: 14 Apr 2004
Posts: 5511
Location: Durham, UK

PostPosted: Wed Apr 05, 2006 8:07 am    Post subject: Reply with quote

Moved from Gamers & Players to Networking & Security.
_________________
No-one's more important than the earthworm.
Back to top
View user's profile Send private message
cgmd
Veteran
Veteran


Joined: 17 Feb 2005
Posts: 1585
Location: Louisiana

PostPosted: Fri Apr 07, 2006 2:48 am    Post subject: Reply with quote

erik258 wrote:
Quote:
so I say
Quote:
ln -s /etc/init.d/net.eth0 /etc/init.d/net.ath0


and
Quote:
lappy init.d # /etc/init.d/net.ath0 restart
* Re-caching dependency info (mtimes differ)...
* Keeping kernel configuration for ath0

how do you like that? now i looked through /etc/init.d/net.eth0 before i did this and if it wouldn't have kept kernel configuration (that is if the device wasn't already UP) it would have started up ath0 just like we wanted to. there you go, your real fix that you haven't yet requested. ; )


I'm not sure where erik258 is going with this... Is this a resolution to the problem???

Please, someone, help!
_________________
"Primum non nocere" ---Galen
Back to top
View user's profile Send private message
erik258
Advocate
Advocate


Joined: 12 Apr 2005
Posts: 2650
Location: Twin Cities, Minnesota, USA

PostPosted: Fri Apr 07, 2006 2:14 pm    Post subject: yes it is Reply with quote

Quote:
Is this a resolution to the problem

surprisingly, yes it is.

I don't know why but this works.

actually, I was doing a fresh install yesterday and was surprised to see the same exact thing in the 2005.0 handbook ! (my cd was out of date).

http://www.gentoo.org/doc/en/handbook/2005.0/handbook-x86.xml?part=1&chap=8

look at Code Listing 15 on that page, it just so happens it's the exact thing i did ; )

-----------------------------------------------------------------------------------------------------------------------

now, as far as this being a solution to your problem:

Quote:

cgmd # /etc/init.d/sshd restart
* Starting eth0


see how networking is concernied? Networking as a dependancy of sshd. So when you
Code:
 cgmd # /etc/init.d/sshd restart

the initscript ends up trying to bring up net.eth0.
Quote:


Bringing up eth0

but it should be using
Quote:
madwifi driver (ath0)

So you probably don't have your ethernet plugged in to anything and 'dhcpcd eth0' ends up badly...
Quote:
* Running dhcpcd ... [ !! ]
* ERROR: Problem starting needed services.
* "sshd" was not started.


and as you can see,since it can't bring up the networks it can't start sshd.

So you should:

Code:

rc-update show | grep eth0;
??see which runlevel eth0 is in, here we assume 'default' but it could b 'boot' instead??
rc-update del eth0 default
??now it doesn't want to start eth0 at boot for us, a good idea for a laptop probably
ln -s /etc/init.d/net.eth0 /etc/init.d/net.ath0
??and if you don't want it to come up only as a required dependancy of ssh you could have it load up on boot
rc-update add net.ath0 default


believe me, it works. I did it myself on my laptop w/ madwifi drivers and an atheros chip and it worked perfectly.
Back to top
View user's profile Send private message
cgmd
Veteran
Veteran


Joined: 17 Feb 2005
Posts: 1585
Location: Louisiana

PostPosted: Fri Apr 07, 2006 8:08 pm    Post subject: Reply with quote

erik258 wrote:
Quote:
So you should:

Code:

rc-update show | grep eth0;
??see which runlevel eth0 is in, here we assume 'default' but it could b 'boot' instead??
rc-update del eth0 default
??now it doesn't want to start eth0 at boot for us, a good idea for a laptop probably
ln -s /etc/init.d/net.eth0 /etc/init.d/net.ath0
??and if you don't want it to come up only as a required dependancy of ssh you could have it load up on boot
rc-update add net.ath0 default


believe me, it works. I did it myself on my laptop w/ madwifi drivers and an atheros chip and it worked perfectly.


I'm still unclear about this... My net.eth0 is not an initscript, but, rather, a symbolic link, itself:
Code:
init.d # ll net.eth0
lrwxrwxrwx  1 root root 6 Mar  3 15:42 net.eth0 -> net.lo

Is this how you have it? Or is this possibly part of my problem?

I appreciate your help with this!
_________________
"Primum non nocere" ---Galen
Back to top
View user's profile Send private message
erik258
Advocate
Advocate


Joined: 12 Apr 2005
Posts: 2650
Location: Twin Cities, Minnesota, USA

PostPosted: Fri Apr 07, 2006 8:37 pm    Post subject: different but equally good Reply with quote

my laptop has a net.eth0
one of my desktop boxes though has the link you describe. but my laptop doesn't it's got a much older system install & that's probably why they're different.

you can still use this method, but instead of symlinking to net.eth0 link to net.lo:
Quote:
ln -s /etc/init.d/net.ath0 /etc/init.d/net.lo
Back to top
View user's profile Send private message
cgmd
Veteran
Veteran


Joined: 17 Feb 2005
Posts: 1585
Location: Louisiana

PostPosted: Sat Apr 08, 2006 1:41 am    Post subject: Reply with quote

erik258 wrote:
Quote:
you can still use this method, but instead of symlinking to net.eth0 link to net.lo:
Quote:
ln -s /etc/init.d/net.ath0 /etc/init.d/net.lo


I already have a net.lo initscript set for boot runlevel. If you meant:
Code:
ln -s /etc/init.d/net.lo /etc/init.d/net.ath0

...I already have that link set up, and it appears that simply removing net.eth0 from the default run level has corrected the ssh problem! :D

Now sshd loads during boot, without problem!

2 remaining issues are the failure of ath0 to grab an IP during boot, and the inability of ntp-client to load during boot because of no IP...

It appears the command dhcpcd ath0 must be registered to make ath0 pull an IP. I have been trying to resolve that issue in another thread, but I haven't been able to come up with an answer. :(

Do you have any thoughts regarding that issue?

Thanks for the useful advice you've given!
_________________
"Primum non nocere" ---Galen
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum