PDA

View Full Version : This card works: Dlink dwl-520+ - But I need to activate it at EVERY boot?


dickinsd
2005-03-01, 07:06 AM CST
First off, this does not appear to be as SIMPLE as ticking the Activate this device at boot in Network Configuration!
------------------------------------

I have installed FC3 on my younger sisters computer, I know I can make it quite appealing to her when I actually get it working.

Her main (pretty much 99%) computer usage is Internet based, so I Need the wireless card to be working.

I have followed Craigs instructions:
http://www.houseofcraig.net/acx100_howto.php

And the card WORKED
Unfortunately, everytime I reboot the machine I need to activate the card again!

I need to do this with Root, so I can't even take the chance and just tell my sister what she needs to do, as she'll get nosey and I'll have a dead FC3 install.

Once you have the files at the top of Craigs How To you basically need to carry out these instructions:

cd /home/danielle/Downloads/acx100-0.2.0pre8_plus_fixes_45
make
make install
depmod
cd ..
tar Pjxf /home/danielle/Downloads/acx_firmware.tar.bz2
ls /usr/share/acx
emacs /home/danielle/Downloads/acx100-0.2.0pre8_plus_fixes_45/scripts/start_net
cd acx100-0.2.0pre8_plus_fixes_45/scripts/
./start_net
ping -c 4 -I wlan0 192.168.2.11
ping -c 4 -I wlan0 cnet.com
ls -l /etc/rc.d/rc.local
echo -e '\n#Bring acx100 device up\ncd /home/danielle/acx100-0.2.0pre8_plus_fixes_45/scripts\n./start_net\n' >> /etc/rc.d/rc.local
echo 'DEVICE=wlan0' > /etc/sysconfig/network-scripts/ifcfg-wlan0
kudzu
neat

BUT like I said it needs activating at every boot.

Everything seems to be in the right place, because all I need to do to get it working is

su -
cd /home/danielle/Downloads/acx100-0.2.0pre8_plus_fixes_45/scripts
./start_net

I get this on the screen:

[root@localhost scripts]# ./start_net
using wlan0.
Module successfully inserted.
Setting rate to 11M auto.
Setting channel 7.
Going to try to join or setup ESSID Wirez.
Setting mode to Managed.
Setting power LED to off.
Waiting for association...10 9 8 OK.
Attempting to use /sbin/dhclient for DHCP, this may take a moment...OK.
Interface has been set up successfully.

I can then browse the web no problem, I can download updates, everything works as it should.

I thought adding these lines (as per Craigs instructions) would make the card auto load at each boot:
echo -e '\n#Bring acx100 device up\ncd /home/danielle/acx100-0.2.0pre8_plus_fixes_45/scripts\n./start_net\n' >> /etc/rc.d/rc.local
echo 'DEVICE=wlan0' > /etc/sysconfig/network-scripts/ifcfg-wlan0
But this does not appear to be the case.

I wonder does anyone know where I am going wrong OR can any one tell me how to make some kind of script that could su -, change to the /home/danielle/Downloads/acx100-0.2.0pre8_plus_fixes_45/scripts directory and activate the card = ./start_net at every boot, OR at every login?

Also, I have noticed that the /etc/hosts file gets trashed everytime I make changes to the network configuration? this does not appear to cause any browsing problems, but does cause an error at every log in, so would it also be possible to add a script that gets root privaliges and adds the localhost info to the /etc/hosts file as well?

Thank you for any help with this

Dave

dickinsd
2005-03-01, 08:23 AM CST
Hi, I am having a similar problem with running a script at startup.

I'm running FC3 and am trying to get my wireless card running. I've got it down to a script I made that I can execute just fine as root and the card will work, but I would like this script to run when any user logs in. I added it to /etc/profile ; however, the script uses some commands like iwconfig and ifconfig which only root has privleges to run, so it just crashes when i run it as a regular user.

My question is how can make this script execute (as if root was executing it) automatically when any user logs in?

Thanks!

the best way to achieve this is to put the script you want to load in /etc/rc.local
whatever command you put in that file is read after the startup services are loaded.
From: http://www.fedoraforum.org/forum/showthread.php?t=32571&highlight=startup+scripts

Seems to be along the lines of what I want, do I actually have to tell rc.local to su - or does it know this itself?

I'm gonna try it now on the other machine, so maybe I'll figure it out my self??

Will this change effect ALL users? (this is what I want, I don't want anyone needing access to root as it would create one big nightmare for me...

Dave

dickinsd
2005-03-01, 08:30 AM CST
Oh no this is not enough for my problem as the command I want it to run is already there, so this is not enough.

Any other ideas?

Dave

james_in_denver
2005-03-01, 09:52 AM CST
Sure, you can put that "start_net" in "/etc/rc.d" then you can to "chkconfig --level 3 start_net on" to have that script automatically started at "runlevel 3".

You would probably want to do the same thing for runlevel "5", the GUI/X-windows login runlevel as well.

And you probably want to "chkconfig --level 0 start_net off" to turn off networking as part of your shutdown procedure.

dickinsd
2005-03-01, 09:56 AM CST
Sure, you can put that "start_net" in "/etc/rc.d" then you can to "chkconfig --level 3 start_net on" to have that script automatically started at "runlevel 3".

You would probably want to do the same thing for runlevel "5", the GUI/X-windows login runlevel as well.

And you probably want to "chkconfig --level 0 start_net off" to turn off networking as part of your shutdown procedure.

Thanks james_in_denver, can I just clarify something - put that "start_net" in "/etc/rc.d"
Do I need to put a complete path list to this script?

Thanks

Dave

ogetbilo
2005-03-01, 10:01 AM CST
Thanks james_in_denver, can I just clarify something -
Do I need to put a complete path list to this script?

Thanks

Dave
Yes. See if it works.

dickinsd
2005-03-01, 10:39 AM CST
Sure, you can put that "start_net" in "/etc/rc.d" then you can to "chkconfig --level 3 start_net on" to have that script automatically started at "runlevel 3".

You would probably want to do the same thing for runlevel "5", the GUI/X-windows login runlevel as well.

And you probably want to "chkconfig --level 0 start_net off" to turn off networking as part of your shutdown procedure.

Thanks for the info. The rc.d file looks like entries need to be formatted, I have no idea how to add anything to it.
My /etc/rc.d file:
/etc/rc.d:
used 144 available 14940212
drwxr-xr-x 10 root root 4096 Mar 1 15:27 .
drwxr-xr-x 78 root root 12288 Mar 1 17:21 ..
drwxr-xr-x 2 root root 4096 Mar 1 02:59 init.d
-rwxr-xr-x 1 root root 2352 Mar 16 2004 rc
drwxr-xr-x 2 root root 4096 Mar 1 02:45 rc0.d
drwxr-xr-x 2 root root 4096 Mar 1 02:45 rc1.d
drwxr-xr-x 2 root root 4096 Mar 1 02:45 rc2.d
drwxr-xr-x 2 root root 4096 Mar 1 02:45 rc3.d
drwxr-xr-x 2 root root 4096 Mar 1 02:45 rc4.d
drwxr-xr-x 2 root root 4096 Mar 1 02:45 rc5.d
drwxr-xr-x 2 root root 4096 Mar 1 02:45 rc6.d
-rwxr-xr-x 1 root root 315 Mar 1 15:27 rc.local
-rwxr-xr-x 1 root root 695 Mar 1 11:30 rc.local~
-rwxr-xr-x 1 root root 26614 Nov 1 20:31 rc.sysinit


I'm not really sure what I need to add to get the ./start_net command in there? also this command ONLY works when I go to the directory where it is storred it is not a command that will work from anywhere like ifconfig or anything, so as well as referrencing the command I need to actually tell it where to look for the command.
Sorry about this, I genuinely don't know what I need to add to this file.

Thank you

Dave

PS: can I take it from this line: -rwxr-xr-x 1 root root 315 Mar 1 15:27 rc.local that this is where the rc.local file is called from, and that the 1 before root means that there is only one entry? (which happens to be where I am currently trying to get this ./start_net to work from.)

james_in_denver
2005-03-01, 11:46 AM CST
My apologies, I made two mistakes in the same post! arghhhhhh.....

Firstly, startup scripts go into "/etc/init.d" (then the "chkconfig" command I mentioned above creates a "link"/"shortcut" from the rc#.d directory to the actual file in /etc/init.d).

And the script files "/etc/init.d" all follow a "pattern" with start and stop "functions" built into them. (If your script follows the pattern, then my earlier post about "chkconfig" will work just fine, if it doesn't follow that pattern, then read on.

The other way to force this to start at system boot time is to edit the "/etc/rc.d/rc.sysinit" file, and add a line with the full path to your "start_net" script at the end of that file.

dickinsd
2005-03-01, 12:07 PM CST
Thank you james_in_denver, the problem actually stems from a mistake I made, I had moved the file to a different location, and 'forgot' to update my damn rc.local file, Void Main told me to send the output to a log file and then told me that the directories are wrong, that is when it hit me :( I have looked at this file at least 30 times today, and I never noticed a VERY basic mistake - shame on me

Thank you for your help

Dave