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 - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-11-2003, 11:12 AM   #1
BajaNick
Senior Member
 
Registered: Jul 2003
Location: So. Cal.
Distribution: Slack 11
Posts: 1,737

Rep: Reputation: 46
Directory/script Question


What directories do i put scripts in to run at startup and at shutdown? thanks
 
Old 08-11-2003, 11:23 AM   #2
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 47
If you want a script to run at startup edit the /etc/rc.local file or put the script in the /etc/profile.d/ and name it bla.sh if you use bash or bla.csh if you use csh.

Shutdown you should put a link in /etc/rc.d/rc.0/ which points to the script. The link should be named SXXscript where XX is a number you can use to determine in what order it is executed.
 
Old 08-11-2003, 01:14 PM   #3
BajaNick
Senior Member
 
Registered: Jul 2003
Location: So. Cal.
Distribution: Slack 11
Posts: 1,737

Original Poster
Rep: Reputation: 46
Im not sure i understand, Can you post an example like a script that wouls run when the system shuts down? thanks
 
Old 08-11-2003, 02:13 PM   #4
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 31
As you have RedHat 9, why do you not look in

/etc/rc.d/rc3.d

to see examples of scripts which are executed when the run level is entered S*, and examples of scripts which are executed when the run level is exited. Note that these are all symbolic links going to files in /etc/rc.d/init.d such that the same script is used for starting up a service and for shutting down by means of a command line parameter.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Directory listing - Calling shell script from a CGI script seran Programming 6 08-11-2005 11:08 PM
shell script: delete all directories named directory.# except directory.N brian0918 Programming 3 07-13-2005 06:54 PM
directory listing script linuxzouk Programming 2 06-04-2004 12:07 PM
script to change directory trout21 Linux - Newbie 9 02-17-2004 12:49 PM
Help with a Directory Compare Script bullfrog Linux - General 1 02-04-2003 08:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:49 AM.

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