LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 08-30-2007, 01:58 AM   #1
shipon_97
Member
 
Registered: Oct 2005
Location: Bangladesh
Posts: 448

Rep: Reputation: 30
script/service/command executes during shutdown


Friends ,

I want to shutdown a Linux service (Like tuxedo service) During shutdown command , i.e., When I have to poweroff my Liux (RHEL 4) server, then some third party installed service will be automatically shutdown before poweroff the server .


I have another question ,

During startup if I want to give some command/scripts (scripts which contains 1 or 2 lines) in "/etc/rc.local" then it will be automaticaly executed during startup the server .

Just Like this , is there any file Like "rc.local" which is executed only during shutdown the server .
Becaue I need to shutdown some third party service(Like tuxedo,cobol) first during shutting down the server .

If any .. plz informed .. ..
 
Old 08-30-2007, 04:19 AM   #2
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,467
Blog Entries: 11

Rep: Reputation: 184Reputation: 184
Coming from slackware i just edited the files /etc/rc.d/{rc.6,rc.0} (one is a symlink) to call a script.

When I recall right in Debian you got "/etc/rc6.d". just create a file like "K50thirdparty". Within you can call scripts or whatever you like.
(The rule on the number of K is the number of the script with the same name and an S in front subtracted by 100. S40thirdparty = K60thirdparty)

But I think the appropiate way to do it is to have the thirdparty script in your default runlevels rc directory. Mostly rc3.d. Just put a K file in there and you should be set. (type runlevel on cmd to see the actual runlevel. vi /etc/inittab can tell you which is your default runlevel.)

For clearence:
All file in the rc*.d directory with a S in front get executed when entering the runlevel. And all the files with a K in front get executed when leaving the runlevel.

Greetz Zhjim
 
  


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
LSB service shutdown tate_harmann Linux - Newbie 1 08-20-2007 04:12 PM
Slack problems 1)incomplete shutdown? 2)starting a service koodoo Linux - Newbie 5 06-08-2005 12:22 PM
Terminal Executes unwanted command at openning blames Linux - General 4 12-28-2004 05:16 PM
creating shell script that executes as root regardless of who runs the script? m3kgt Linux - General 13 06-04-2004 11:23 PM
Service Shutdown and Init Setup g_goblin Solaris / OpenSolaris 1 10-29-2003 04:53 PM


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