LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 12-06-2004, 03:24 PM   #1
desbyleo
Member
 
Registered: Feb 2002
Location: Erie, CO
Distribution: Red Hat 7.1
Posts: 94

Rep: Reputation: 15
Run Control Scripts


I'm trying to use a script that automatically shutdowns my databases on server shutdown/reboots.

I have a script K01orastop.sh in /etc/rc2.d
When I call the script from a su session, it runs fine. But when I shutdown/reboot the server, the scripts is it being ran.

What am I doing wrong?
 
Old 12-06-2004, 04:39 PM   #2
desbyleo
Member
 
Registered: Feb 2002
Location: Erie, CO
Distribution: Red Hat 7.1
Posts: 94

Original Poster
Rep: Reputation: 15
Well...i think I figured out my problem: I'm a rookie!

I guess its common sense to most that contents of /etc/rc2.d is only read when the system is DELIBERATELY changed to run-level 2. And I guess the same can be said about /etc/rc1.d and run-level 1.

I assumed that when a shutdown or reboot command is issued, the system will traverse through all the run-levels on it's way down (3-2-1-0; or 6-5-4-3-2-1-0). So I assumed that the /etc/rc2.d contents will get read when the system is shutdown/rebooted. This is not true, apparently, as I soon find out by skimming through /sbin/rc6 or /sbin/rc0.
 
Old 12-07-2004, 01:15 AM   #3
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
Yes, put the script in rc6.d when you are rebooting your server and 0 and 5 when you are shutting down.

-twantrd
 
  


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
new scripts won't run new2me Linux - Newbie 4 06-09-2005 10:14 AM
How do i get scripts to run? jihadcman Fedora 3 06-06-2004 11:15 AM
how do you run scripts toejam Linux - General 5 05-24-2004 09:24 AM
cannot run scripts unless su odious1 Linux - General 5 07-19-2003 01:25 AM
Run Control scripts... rc.x, etc. tarballed Linux - General 1 02-26-2003 01:27 PM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

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