LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Automatic module loading... how? (https://www.linuxquestions.org/questions/linux-networking-3/automatic-module-loading-how-286143/)

Hungry ghost 02-04-2005 07:37 AM

Automatic module loading... how?
 
Hi, I'm using Fedora Core 3 and installed a slmodem-2.9.10_netodragon driver for a Neto Dragon modem. The Problem is every time I boot, if I want to connect to internet, I must execute "/sbin/modprobe slamr", "/usr/sbin/slmodemd/slamr0" and "ln -s /dev/ttySL0 /dev/modem" (I always create the simbolic link and it always disappears when I boot). My question is how can I make all this process automatic, so I don't have to do it all the time I boot? Thanks in advance.

ilikejam 02-04-2005 07:52 AM

Hi.

You could put those three commands into /etc/rc.d/rc.local

They'll be executed just before the login screen comes up.

Dave

Hungry ghost 02-04-2005 11:29 AM

Hi, thanks for your help. I edited /etc/rc.d/rc.local and I rebooted to test it, but I had no results. When booting I saw "/usr/sbin/slmodemd /dev/slamr0" command and an error message, but the screen changed inmediatly, and I couldn't read the message. The lines I added to rc.local are:

/sbin/modprobe slamr
/usr/sbin/slmodemd /dev/slamr0 &

I checked the paths to these commands and are ok. Should I eliminate the "&" sign in the last command?? What could be the problem??
Thanks in advance.

ilikejam 02-04-2005 11:37 AM

Try dumping the output from the commands to a text file.

e.g.
/sbin/modprobe slamr &> /modpErrors
/usr/sbin/slmodemd /dev/slamr0 &> /slmodErrors &

Then have a look in the /modpErrors and /slmodErrors files to see what's going on.

The trailing & on the slmodemd shouldn't be a problem.

Dave

zr0gravity 02-04-2005 12:00 PM

I would eliminate the & as it's really unnecessary when loading at boot-time. If you execute these commands normally and they run, then running them from your rc.local at boot-time should work just fine.

I am confused as to why the symbolic link is dissappearing at boot. I'm also confused by you saying:

...I must execute "/sbin/modprobe slamr", "/usr/sbin/slmodemd/slamr0" and "ln -s /dev/ttySL0 /dev/modem" (I always create the simbolic link and it always disappears when I boot).

But then you say you've added the following lines to your rc.local:

/sbin/modprobe slamr
/usr/sbin/slmodemd /dev/slamr0 &

"/usr/sbin/slmodemd/slamr0" shows that "slmodemd" is clearly a directory.
but you've issued "/usr/sbin/slmodemd /dev/slamr0 &" in your rc.local which shows that "slmodemd" is not a directory, but an executable binary.

Could you please clarify why it is that you've put this in your rc.local file or if this was a typo or what?

I'll try to help where I can.

zr0

ilikejam 02-04-2005 12:16 PM

As a side note, the /dev/modem is dissappearing because Fedora C 3 uses udev, so all the device nodes are created at boot.

Hungry ghost 02-04-2005 01:51 PM

Hi, thanks both. Ok, I added the following lines to rc.local:

/sbin/modprobe slamr &> /modpErrors
/usr/sbin/slmodemd /dev/slamr0 &> /slmodErrors &
ln -s /dev/ttySL0 /dev/modem

The output of modprobe was a blank page (no errors, it seems). The output of slmodemd was the following:

error: mdm setup: cannot stat `/dev/slamr0': No such file or directory
error: cannot setup device `/dev/slamr0'

The weird thing is that when I su and do it manually after boot, it does work. Besides, after editing rc.local I don't have to execute "/sbin/modprobe slamr" after boot, just the slmodemd command. By the way, there's a space between " /usr/sbin/slmodemd" and "/dev/slamr0" :)

ilikejam 02-05-2005 08:36 AM

Try adding a delay between modprobing and running slmodemd

e.g.
/sbin/modprobe slamr &> /modpErrors
sleep 3
/usr/sbin/slmodemd /dev/slamr0 &> /slmodErrors &
ln -s /dev/ttySL0 /dev/modem

Dave

Hungry ghost 02-07-2005 08:26 PM

Hi I added the delay as you said, but I'm getting the same error, well I think that after all I'm getting used to execute the slmodemd command after boot, lol. Thank you anyway.


All times are GMT -5. The time now is 03:41 PM.