HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- run script when shutdown
Operating System - HP-UX
1836694
Members
2455
Online
110108
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
10-04-2002 08:27 PM
10-04-2002 08:27 PM
run script when shutdown
How can the system automatically run the scripts such as shutdown db , logout users when the system is shutdown?
Thx.
Thx.
Andy
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2002 08:55 PM
10-04-2002 08:55 PM
Re: run script when shutdown
Hi,
Here's a partial answer:
1- write your script in a case segment including start, stop, start commands
2- save the script in /sbin/rc.init.d/your_script
3- create a symbolic link to this file in /sbin/rcR.d/ where R is the appropriate run level during STARTUP. Name the link sarting with an S (start) like (S540) the numbers here are for the order execution during startup.
4- create another symbolic link for the file in /sbin/rcR.d/ where R is the appropriate run level during SHUTDOWN.
Name the link sarting with an K (Kill) like (K540) the numbers here are for the order execution during shutdown.
4- Create additional configuration parmeters if any in /sbin/rc.config.d/ with the same name in /sbin/init.d/
Hope this works,,,,
Good Luck.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2002 05:51 AM
10-05-2002 05:51 AM
Re: run script when shutdown
Hi,
As a general rule, you create the symbolic link for the stop case of your script one run level less than where you start it. In other words, if you start a process at run level 3, you generally want to stop it at run level 2.
For example:
create /sbin/init.d/myscript
ln -s /sbin/init.d/myscript /sbin/rc3.d/S100myscript
ln -s /sbin/init.d/myscript /sbin/rc2.d/K900myscript
Darrell
As a general rule, you create the symbolic link for the stop case of your script one run level less than where you start it. In other words, if you start a process at run level 3, you generally want to stop it at run level 2.
For example:
create /sbin/init.d/myscript
ln -s /sbin/init.d/myscript /sbin/rc3.d/S100myscript
ln -s /sbin/init.d/myscript /sbin/rc2.d/K900myscript
Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2002 06:33 AM
10-05-2002 06:33 AM
Re: run script when shutdown
How about spending some time fixing this? it's just plain laziness and lack of RESPECT for your fellow system admins that irks me to no end!
This member has assigned points to 158 of 347 responses to his/her questions.
You can find ALL of your previous posts here:
http://forums.itrc.hp.com/cm/TopSolutions/1,,CA759973!1!questions,00.html
live free or die
harry
Live Free or Die
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP