HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: test_return in package control
Operating System - HP-UX
1836979
Members
2144
Online
110111
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
Go to solution
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
11-20-2001 05:19 AM
11-20-2001 05:19 AM
What does the function test_return in the function customer_defined_run_cmds do? (and where are the docs for this) Is there a way to indicate failure? What are the consequences when a non-zero return code results?
For example, if my run command is
su - oracle -c "/u01/app/oracle/BIN/startup.sh c7d52"
, I can get startup.sh to test for Oracle's pmon existence and return 1 perhaps. What are the consequences if I do?
Also, is there any way to get the cluster to watch for changes in the pmon existence to properly indicate the up/down status of Oracle?
Ryan
For example, if my run command is
su - oracle -c "/u01/app/oracle/BIN/startup.sh c7d52"
, I can get startup.sh to test for Oracle's pmon existence and return 1 perhaps. What are the consequences if I do?
Also, is there any way to get the cluster to watch for changes in the pmon existence to properly indicate the up/down status of Oracle?
Ryan
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2001 05:29 AM
11-20-2001 05:29 AM
Solution
You can actually look at what test_return does, at the bottom of your package control script.
The short answer is that test_return expect $? to be zero if the application has started successfully if it doesn't guess what? test_return stops any services, runs your customer defined halt commands, and stops the package.
So make sure your getting a valid return code from the command before test_return.
Of course, if you have monitoring services defined, you may be checking that the application has started OK elsewhere, in which case test_return is not so important here, and you *could* comment it out - but as a believer in 'belt and braces' I wouldn't do that!
HTH
Duncan
I am an HPE Employee
The short answer is that test_return expect $? to be zero if the application has started successfully if it doesn't guess what? test_return stops any services, runs your customer defined halt commands, and stops the package.
So make sure your getting a valid return code from the command before test_return.
Of course, if you have monitoring services defined, you may be checking that the application has started OK elsewhere, in which case test_return is not so important here, and you *could* comment it out - but as a believer in 'belt and braces' I wouldn't do that!
HTH
Duncan
I am an HPE Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2001 05:35 AM
11-20-2001 05:35 AM
Re: test_return in package control
Hi Ryan,
the test_return function is basically a clean way of handling the various errors that may occur whilst the package is starting/running/stopping. If you look at the logic, it should output an appropriate error message based on the function argument (if non-zero), then exit accordingly.
Rgds, Robin.
the test_return function is basically a clean way of handling the various errors that may occur whilst the package is starting/running/stopping. If you look at the logic, it should output an appropriate error message based on the function argument (if non-zero), then exit accordingly.
Rgds, Robin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2001 05:43 AM
11-20-2001 05:43 AM
Re: test_return in package control
Missed your last question...
Yes, you can monitor whether pmon is running - this is what MC/SG services are for
T simplify things a touch, if you'd defined a service called ora_mon in you control script like this:
SERVICE_NAME[0]="ora_mon"
SERVICE_CMD[0]="/etc/cmcluster/oracle/ora_mon"
SERVICE_RESTART[0]=" "
ANd in your package configuration script like this:
SERVICE_NAME ora_mon
SERVICE_FAIL_FAST_ENABLED NO
SERVICE_HALT_TIMEOUT 0
And your script looked like this:
while true
do
ps -ef | grep -q [o]ra_pmon_sidname || exit
done
Then if Oracle crashed, and ora_pmon_whatever died, then the ora_mon process would detect this, and exit, and this would cause ServiceGuard to initiate a failover.
In practice people want to do much more than this, such as attempt recovery actions or not monitor during a cold backup or maintenance - but this really depends on your requirement.
HTH
Duncan
I am an HPE Employee
Yes, you can monitor whether pmon is running - this is what MC/SG services are for
T simplify things a touch, if you'd defined a service called ora_mon in you control script like this:
SERVICE_NAME[0]="ora_mon"
SERVICE_CMD[0]="/etc/cmcluster/oracle/ora_mon"
SERVICE_RESTART[0]=" "
ANd in your package configuration script like this:
SERVICE_NAME ora_mon
SERVICE_FAIL_FAST_ENABLED NO
SERVICE_HALT_TIMEOUT 0
And your script looked like this:
while true
do
ps -ef | grep -q [o]ra_pmon_sidname || exit
done
Then if Oracle crashed, and ora_pmon_whatever died, then the ora_mon process would detect this, and exit, and this would cause ServiceGuard to initiate a failover.
In practice people want to do much more than this, such as attempt recovery actions or not monitor during a cold backup or maintenance - but this really depends on your requirement.
HTH
Duncan
I am an HPE Employee

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