- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Shutdown script
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
12-23-2002 09:41 PM
12-23-2002 09:41 PM
I would like to know whether any place/script used when the system being shutdown gracefully.
E.g. I want add some additional commands in shutdown script. If I am correct in hp-ux 9.x /etc/shutdown was the place you put any script will executed when system being shutdown. in 11.x how to do the same thing. it may be possible by adding the lines to any of the K??? scripts in /sbin/rc0.d
Or may be I need to edit /sbin/rc
Is there any other easy way?
Thanks in advance
TT
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2002 09:51 PM
12-23-2002 09:51 PM
Re: Shutdown script
It may be that I misunderstand your question, but the best way is to "balance" your stop/start scripts.
Example : Let's say you start Oracle somewhere at the beginning of runlevel 3 :
wroot/sv00239#ll /sbin/rc3.d
total 0
lrwxr-xr-x 1 root sys 19 Sep 26 2001 S009oracle -> /sbin/init.d/oracle
Then logic would dictate you stop Oracle at the end of runlevel 2 :
wroot/sv00239#ll /sbin/rc2.d
total 0
lrwxr-xr-x 1 root sys 19 Sep 26 2001 K991oracle -> /sbin/init.d/oracle
I try to "complement" the links (S009 versus K991). This avoids confusion ...
Was this what you are looking for ?
Regards,
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2002 10:01 PM
12-23-2002 10:01 PM
Re: Shutdown script
The system is triggering a shutdown due to shutdown command executed, or hardware failure such as over temp/chasis fan ..etc.
It is as simple as that, when system being shutdown, the system should send a e-mail.
I think in /etc/rc0.d editing any K??? script will do, but is there any other place?
TT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2002 10:06 PM
12-23-2002 10:06 PM
Re: Shutdown script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2002 10:55 PM
12-23-2002 10:55 PM
Re: Shutdown script
Sorry for not understanding the question in the first place. I'm afraid there is no easy way. You might be able to "catch" some cases with the envd-daemon (check "man envd" for more information). Using EMS will give you an indication of why the system went down.
Note that the mailservices are probably no longer running when you get to /sbin/rc0.d in an ordinary shutdown !
Regards,
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2002 11:02 PM
12-23-2002 11:02 PM
Re: Shutdown script
I think you are correct!
I could edit /etc/envd.conf to send mails in case of over temp or fan failure. But when some one gracefully shutting down the system, how to generate mail? Should I do it in run level 3 to 2 transition(/sbin/rc2.d/K???), because runlevel 1 will not be running networking/sendmail deamons. Correct me If I am wrong.
TT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2002 12:00 AM
12-24-2002 12:00 AM
Re: Shutdown script
No correction needed, if you want the mail, do it before the daemons (not to mention the network) are down.
An alternative might be to have your systems monitored (by HP Openview as an - very expensive - example).
Regards,
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2002 08:31 AM
12-24-2002 08:31 AM
Re: Shutdown script
Starting with 10.0 the startup/shutdown paradigm changed. The document link below offers a pdf file which applies to HP-UX starting with 10.0 and continuing through current 11i releases. It should easily answer all your questions.
http://docs.hp.com/hpux/onlinedocs/os/startup.pdf
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2002 01:39 PM
12-24-2002 01:39 PM
SolutionNow create 2 symlinks to /sbin/init.d script in /etc/rc2.d and call it K090startstopnotify and S992startstopnotify as an example. The script might just use mailx to send a mail or pager message.
The concept behind the start/stop scripts is to break up independent features so they can be selectively enabled at bootup (and shutdown in a formal manner). The S992 link name ensures that the startstopnotify script is one of the last scripts run at startup. This is because you'll likely need networking and sendmail functional before you send the notification. Conversely, K099 means that the notification will go out before sendmail and networking are terminated. By keeping all the notification functions in this script, you won't have to worry about HP-UX standard scripts getting patched and losing custom code.
See attached example.
Bill Hassell, sysadmin