LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-03-2004, 07:47 AM   #1
awejevlen
LQ Newbie
 
Registered: May 2004
Posts: 6

Rep: Reputation: 0
boot/startup/autorun commands


How would I set a console command to boot at startup? The command I would like to run each time is modprobe ndiswrapper. This will allow me to not have to manually initialize my wireless card. Thanks.
 
Old 05-03-2004, 08:01 AM   #2
aaa
LQ Guru
 
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194

Rep: Reputation: 46
Take a look at /etc/modules.conf
 
Old 05-03-2004, 08:02 AM   #3
andredude
Member
 
Registered: Dec 2003
Location: Johannesburg, South Africa
Distribution: Mandrake
Posts: 48

Rep: Reputation: 15
put it in /etc/profile?
 
Old 05-03-2004, 11:31 AM   #4
arvind_sv
Member
 
Registered: Oct 2002
Location: Bangalore
Distribution: Gentoo Linux
Posts: 96

Rep: Reputation: 16
Hi,

aaa's way of putting it in /etc/modules.conf is the right way to do it. If you have some reason not to, then, you can read on.

I'm assuming you have a RedHat distribution or something similar.

Think about creating a file in /etc/rc.d/init.d or /etc/init.d. Just look at the other files in the directory and you'll have an idea about how to go about creating the file.

It should look something like this: [file: /etc/rc.d/init.d/wireless]

Code:
#!/bin/bash
#
# chkconfig: 2345 85 15
# description: Initialize wireless card.

. /etc/init.d/functions

start() {
    echo -n $"Initializing wireless card"
    modprobe ndiswrapper
}

stop() {
    echo -n $"Unloading wireless card module"
    rmmod ndiswrapper
}

case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    restart)
        stop
        start
        ;;
    *)
        echo $"Usage: $0 {start|stop|restart}"
        exit 1
        ;;
esac

exit 0
Then, if you use RedHat, you can do this:
/sbin/chkconfig --add wireless

Arvind
 
Old 05-03-2004, 03:03 PM   #5
Grasshopper
Member
 
Registered: Nov 2003
Location: CT, USA
Posts: 55

Rep: Reputation: 15
Modules to be loaded at boot time in a 2.4.x kernel are placed in /etc/modules.conf

Modules to be loaded at boot time in a 2.5.x or 2.6.x kernel are placed in /etc/modprobe.preload

From /etc/modules.preload:

# /etc/modprobe.preload: kernel modules to load at boot time.
#
# This file should contain the names of kernel modules that are
# to be loaded at boot time, one per line. Comments begin with
# a `#', and everything on the line after them are ignored.
# this file is for module-init-tools (kernel 2.5 and above) ONLY
# for old kernel use /etc/modules

I had a very similar problem that this solved.
 
Old 05-04-2004, 07:22 AM   #6
awejevlen
LQ Newbie
 
Registered: May 2004
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks arvind_sv that little script worked. Its now automatically recognized at startup.
 
Old 05-04-2004, 07:52 AM   #7
arvind_sv
Member
 
Registered: Oct 2002
Location: Bangalore
Distribution: Gentoo Linux
Posts: 96

Rep: Reputation: 16
You're welcome.

Arvind
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Startup and Running Commands Post Boot nmitchell Debian 5 08-17-2005 06:37 PM
autorun commands dhave Slackware 2 05-16-2005 04:34 PM
Running autorun daemon on startup basemodel Linux - Software 4 08-20-2004 05:31 PM
autorun at boot anthjaz Linux - General 10 05-06-2004 09:02 PM
Stop autorun run at startup digitalbrutus Linux - Software 4 05-02-2004 01:37 PM


All times are GMT -5. The time now is 09:19 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration