LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 07-11-2007, 11:11 PM   #1
harkonen
Member
 
Registered: May 2007
Distribution: slackware
Posts: 46

Rep: Reputation: 16
rc.local question


I have been playing around with automating bringing my wireless card online at boot. As I read in an earlier forum post, this should be done with rc.local

I successfully have the daemon for the card itself loading at boot via rc.local.....but when I add things like:

modprobe ipw3945
iwconfig eth1 essid XXXXX
iwconfig eth1 channel 10
iwconfig eth1 key XXXXXXX
ifconfig eth1 up
dhcpcd eth1

-- all of which gets me online seamlessly after I've logged in -- but during boot I get the message: eth1 device does not exist.

Any idea how to fix this?

As a temporary fix, I've written a script to do all of this for me after I've logged in, but I can only run it as root...yeah, I'm [still] a noob.
 
Old 07-11-2007, 11:20 PM   #2
2Gnu
Senior Member
 
Registered: Jan 2002
Location: Southern California
Distribution: Slackware
Posts: 1,880

Rep: Reputation: 51
Put the network parameters in /etc/rc.d/rc.inet1.conf. The inet1 script is written so that everything will happen in the correct order - you won't be trying to run a command against an interface that doesn't exist yet.

Put the modprobe call in /etc/rc.d/rc.modules (a soft link to your current modules list).
 
Old 07-11-2007, 11:22 PM   #3
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
Since there are not enviroment values set at that time (like PATH) you've to write the commands with full path, like: /sbin/modprobe ipw3945

As 2Gnu said, there are already files created to set up modules and network stuff at boot. But it's up to you to choose which one to use, freedom

Last edited by gbonvehi; 07-11-2007 at 11:23 PM.
 
Old 07-11-2007, 11:39 PM   #4
harkonen
Member
 
Registered: May 2007
Distribution: slackware
Posts: 46

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by gbonvehi
Since there are not enviroment values set at that time (like PATH) you've to write the commands with full path, like: /sbin/modprobe ipw3945

As 2Gnu said, there are already files created to set up modules and network stuff at boot. But it's up to you to choose which one to use, freedom
Cool. I'm trying this idea out. I tried 2Gnu's instructions but they didn't work...but then, I didn't provide the full path for my iwconfig stuff. I did for my modprobe because all the samples contained the path.

Thanks, both, for the advice. I will post results........
 
Old 07-12-2007, 12:11 AM   #5
harkonen
Member
 
Registered: May 2007
Distribution: slackware
Posts: 46

Original Poster
Rep: Reputation: 16
modprobe is working fine; confirmed with lsmod.

the rest of it is not working; i have a feeling i am just entering the info in the wrong format.

Here is what i put into my rc.inet1.conf file:

Quote:
#Config information for eth1:
IPADDR[1]=""
NETMASK[1]=""
USE_DHCP[1]=""
DHCP_HOSTNAME[1]=""
/sbin/iwconfig eth1 essid XXXXX
/sbin/iwconfig eth1 channel 10
/sbin/iwconfig eth1 key XXXXXXX
/sbin/ifconfig eth1 up
/sbin/dhcpcd eth1
The first five lines were there already and I..obviously..hadn't a clue what to do with them. So I just added the commands I knew worked elsewhere and hoped for the best....but I have a feeling this was not the correct way of doing this.

Do I need to format this differently or use different syntax?

Thanks..
 
Old 07-12-2007, 12:11 AM   #6
bioe007
Member
 
Registered: Apr 2006
Location: lynnwood, wa - usa
Distribution: archlinux
Posts: 654

Rep: Reputation: 30
have you looked at rc.wireless.conf ? and rc.inet1 yet? you can set all that stuff up in there.


Quote:
eth1 device does not exist.
it sounds like you tried this out whilst already booted up? (I'm guessing) but when you reboot udev is likely not labeling your wifi interface 'eth1' (perhaps wlan0).
 
Old 07-12-2007, 12:21 AM   #7
harkonen
Member
 
Registered: May 2007
Distribution: slackware
Posts: 46

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by bioe007
have you looked at rc.wireless.conf ? and rc.inet1 yet? you can set all that stuff up in there.
Thanks, bioe007.

I just looked at rc.inet1 and realised that rc.inet1.conf is feeding data into it, so I think I will spend some time tonight reading thru rc.inet1 and rc.wireless and try to figure out what information goes where, and try to fill it all in appropriately. After looking at the scripts themselves I have a feeling that I know the information I need, I just need to learn where to put it.

Anyway, I got the modprobe working so that was worth the post. Thanks everyone for your helsp
 
Old 07-12-2007, 02:09 AM   #8
harkonen
Member
 
Registered: May 2007
Distribution: slackware
Posts: 46

Original Poster
Rep: Reputation: 16
OK, I got it working; and while the following information may be old news to the pros, I felt like I should document how I reached my end result for people who are as clueless as I am::

Added to /etc/rc.d/rc.modules under "Other network hardware drivers:"
/sbin/modprobe ipw3945

The default /etc/rc.d/rc.wireless.conf looked like this:
INFO="Any ESSID"
ESSID="Any"
;;

And so I changed it to read:
INFO="Any ESSID"
ESSID="XXXXXX"
KEY=XXXXXXXXX
;;

These changes essentially knocked out the need to do all of my iwconfig settings that I mentioned in my original post (above). But in order to get online, I found that I still had to type in
ifconfig eth1 up
dhcpcd eth1

So I compared "ifconfig" results while not online to my "ifconfig" results while I was online. The difference was that whilst online, my ifconfig revealed my inet addr, Bcast, and Mask. And whilst not online, the line containing that information was missing.

To fix this, I opened /etc/rc.d/rc.inet1.conf and - sure enough - noticed that my eth1 configs were empty. So......

I just added into the template rc.inet1.conf provides my:
IPADDR (ip address)
NETMASK
and changed USE_DHCP="" to USE_DHCP="yes"

Reboot. And I'm online automaticaly.

A huge thanks to 2Gnu, gbonvehi, and bioe007

Hope this helps someone else in the future......
 
Old 07-12-2007, 10:20 AM   #9
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Hi,

Just a comment. You could have run 'netconfig' from a console/cli as root to configure your network. This will produce the /etc/rc.d/rc.inet1.conf' file.

Check some of the references in 'Slackware LQ Suggestions!'.
 
Old 07-12-2007, 10:56 AM   #10
harkonen
Member
 
Registered: May 2007
Distribution: slackware
Posts: 46

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by onebuck
Hi,

Just a comment. You could have run 'netconfig' from a console/cli as root to configure your network. This will produce the /etc/rc.d/rc.inet1.conf' file.

Check some of the references in 'Slackware LQ Suggestions!'.

Yeah, thanks. I did that, actually, but somehow I screwed it up because my rc.inet1.conf file had my IP and Netmask in the eth0 slot rather than my eth1 slot. I'll have to try it again just to see what I did wrong.

Thanks!
 
Old 07-12-2007, 11:55 AM   #11
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Quote:
Originally Posted by harkonen
Yeah, thanks. I did that, actually, but somehow I screwed it up because my rc.inet1.conf file had my IP and Netmask in the eth0 slot rather than my eth1 slot. I'll have to try it again just to see what I did wrong.

Thanks!
Hi,

You can edit '/etc/rc.d/rc.inet1.conf' with any good text editor. I use 'vi'. Just make sure the changes you make are the ones you want!

Restart the 'inet' with '/etc/rc.d/rc.inet1 restart' from the cli.
 
  


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
Garbage Collection in C : Local variables question duryodhan Programming 13 12-04-2006 07:16 AM
Small question about /etc/rc.local - Symbolic link question Arodef Linux - General 4 05-13-2006 02:29 AM
little samba local networking question araldit Linux - Networking 4 03-21-2004 12:17 PM
Question about my Local Network, HELP PLEASE TiMo Linux - Networking 8 08-11-2003 07:42 AM
rc.local question BoldKiller Linux - General 1 12-11-2002 08:53 PM

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

All times are GMT -5. The time now is 08:17 PM.

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