- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: halting some application
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2006 11:34 PM
08-06-2006 11:34 PM
We want to halt some application through scripts...for example when we shutdown the server ...first it run the script and halt the application and then it shutdown the server..so i want to know where we will reside the halting script so that it works while shutting down the server
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2006 11:44 PM
08-06-2006 11:44 PM
Re: halting some application
so make a script for shuting aplication and on the end give shutdown command....
find where halt is, it should be in /usr/bin or /sbin
so make ln -s your_script /bin/halt
now because /bin is before /usr/bin or /sbin (check PATH) so it will run your script...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2006 11:45 PM
08-06-2006 11:45 PM
Re: halting some application
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2006 12:56 AM
08-07-2006 12:56 AM
Re: halting some application
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2006 01:30 AM
08-07-2006 01:30 AM
Re: halting some application
services sshd stop
.
.
.
/sbin/halt (or where is your original halt)
and you name this script as halt and place it in /bin
it's OK if you know your sevices and it's OK
other way is make script which, find services you wanna stop before halting system....
ps will give you list of services... then grep, and cut will help you to find PIDs of services you wanna stop and next you stop them with kill PID or (but it's not very nice kill -9 PID)
here is documentation which will help you with scripts... http://www.tldp.org/LDP/abs/html/
man grep
man ps
man kill
will help you with commands you will need...
anyway if something is unclear you can ask
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2006 01:46 AM
08-07-2006 01:46 AM
SolutionWhat OS do you have....??
If you have linux, then the best way is to put the script at the location "/etc/init.d/<script>"
After this, go to /etc/rc.d/rc0.d/ and create a symlink to the file using the command ---
ln -s /etc/rc.d/rc0.d/
The reason behind is simple, when we halt the system, it changes the init level to 0 and after that it reads the directory rc0.d where it finds all the KILL SCRIPTS that needs to be stopped, so when it will find your script as well, it will stop that particular process/service.
--
Atul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2006 02:21 AM
08-07-2006 02:21 AM
Re: halting some application
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2006 03:22 AM
08-07-2006 03:22 AM
Re: halting some application
I tried this to put in rc0.d directory, some how it is not working. But if I put this script in rc6.d and shutdown the system with init 6 command it performs well and doing all which I mentioned in script.Do u think is there any problem in K number which number I should use.Also one thing when I tried with S number in rc0.d directory it call the script but all services goes down before activating this script so many resources it can't find which is necessary for this script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2006 12:03 PM
08-07-2006 12:03 PM
Re: halting some application
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2006 05:54 PM
08-07-2006 05:54 PM
Re: halting some application
As you have specified that when you put S in front of this script, it is killed at the end and few other services that are needed for this script to run are killed before this one gets executed.
So, to resolve this problem, after S try putting in a no. like 01, so that it will be the first to get executed and all other scripts will get executed after this but it may be possible that you may have to change the nos. present on other scripts as well.
--
Atul