LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-04-2006, 06:16 AM   #1
Brynn
Member
 
Registered: Jul 2006
Location: Grimsby UK
Distribution: ubuntu 7.04
Posts: 61

Rep: Reputation: 15
Running a script on boot


there was a thread on here a few weeks ago but i can't find it. so here we go again.
I've made a bash script to start my wifi card called wlan.sh, can anybody please tell me where i have to put it so that it'll start on boot, there seems to be quite a few of rc.d directories and i'm not sure what i'm doing. I'm running fedora core 5.

cheers guys
 
Old 08-04-2006, 06:48 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
If you want to take advantage of having per-runlevel initscripts, format it like a proper service script and put it in /etc/rc.d/init.d (see scripts there for examples) and use chkconfig to link it to runlevels. This for instance would allow you to run wpa_supplicant in wait+background mode before bringing up networking which you can't do by stuffing the script in /etc/rc.d/rc.local.

EDIT: since it's related to networking maybe check first if the commands you use could be run from say the start section of the networking script. Else / if unsure just post your script.

Last edited by unSpawn; 08-04-2006 at 06:52 AM.
 
Old 08-04-2006, 08:03 AM   #3
doronunu
Member
 
Registered: Dec 2005
Location: Israel
Distribution: used : Ubuntu, Debian, Arch. current : Centos.
Posts: 69

Rep: Reputation: 15
well on fedora you need to put the script on /etc/rc.local which make it work on every boot no matter which run level the machine run, or if you want it to run only in specific init you need to put it on the appropriate /etc/rc(init number).d directory and then you need to to run the command :
Quote:
chkconfig --level therunlevelnumber thescriptname on
the script must contain two lines at the strart like here in the example :

Quote:
chkconfig: - 60 20
# description: NFS is a popular protocol for file sharing across TCP/IP \
# networks. This service provides NFS server functionality, \
# which is configured via the /etc/exports file.
the first line is the chkconfig option wich tell the boot in which order to start the script at boot in the current started init and in which order to stop him when u change init or rebooting your machine. it only have meaning if your script depends on other daemon. if it does then it should start after the daemon.
the second line is the description line which contain the description on your script.
if the script wont contain those 2 lines the script wont run on boot.
 
Old 08-04-2006, 08:09 AM   #4
anupamsr
Member
 
Registered: Sep 2004
Location: India
Distribution: Kubuntu, Archlinux, Suse, Gentoo, Mandrake
Posts: 371

Rep: Reputation: 30
Smile

See this old thread for reference.
It is for suse, but then, it is for reference.

Last edited by anupamsr; 08-04-2006 at 08:11 AM.
 
  


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
running script at boot time bigtl Fedora 3 12-19-2005 11:30 AM
Running a script to start WiFi on boot nanodano Linux - Hardware 3 11-06-2005 09:00 PM
Newbie question - running a script at boot time Napalm Llama Red Hat 8 04-19-2005 03:11 PM
Running a script spacemonk Linux - Newbie 4 07-30-2004 04:02 AM
How to Do the Following? Running Script at Boot-Time + Sending Mail LinuxGeek Linux - General 1 07-20-2004 12:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:10 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