- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: customer_defined_run_cmds{}
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
06-30-2002 04:45 PM
06-30-2002 04:45 PM
Can anybody please let me know a few examples as for what exactly the function needs to include to run when the package is started up?
Roger
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2002 04:51 PM
06-30-2002 04:51 PM
Re: customer_defined_run_cmds{}
These are basically command/functions/programs
you would run before the package is started.
Say you have configured database in cluster and want to check some services - like monitoring, listener then you can such stuff here.
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2002 05:10 PM
06-30-2002 05:10 PM
Re: customer_defined_run_cmds{}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2002 11:47 PM
06-30-2002 11:47 PM
SolutionHere is an example of starting/stopping a web servre:
function customer_defined_run_cmds
{
# ADD customer defined run commands.
/opt/hpwebsuite/ns-enterprise/https-hpwing72/start
/opt/hpwebsuite/ns-enterprise/start-admin
test_return 51
}
# This function is a place holder for customer define functions.
# You should define all actions you want to happen here, before the service is
# halted.
function customer_defined_halt_cmds
{
# ADD customer defined halt commands.
/opt/hpwebsuite/ns-enterprise/https-hpwing72/stop
/opt/hpwebsuite/ns-enterprise/stop-admin
test_return 52
}
# END OF CUSTOMER DEFINED FUNCTIONS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2002 01:40 AM
07-01-2002 01:40 AM
Re: customer_defined_run_cmds{}
function customer_defined_run_cmds
{
# ADD customer defined run commands.
start_db.sh
test_return 51
}
BUT if your routine didn't return any meaningful return code then perhaps you might want to have another routine that checks the DB started and returned 0 on success:
function customer_defined_run_cmds
{
# ADD customer defined run commands.
start_db.sh
check_db_is_up.sh
test_return 51
}
HTH
Duncan
I am an HPE Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2002 07:14 AM
07-01-2002 07:14 AM
Re: customer_defined_run_cmds{}
1. Can I start up my applications, ex, start_db.sh in Serivce script, and also monitor these applications in it too.
2. Why alway return 51, which indicate some errors based on the test_return() function. As Duncan said, you only return non-zero, if you have problem with customer_defined_run_cmds{} function.
Please advice, and points will be assigned.
thanks,
Roger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2002 07:17 AM
07-01-2002 07:17 AM
Re: customer_defined_run_cmds{}
The commands run under this procedure are the ones required to execute / monitor etc for the package application you have configured. These can be anything related to the application package you want to run when the package is starting.
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2002 04:23 AM
07-02-2002 04:23 AM
Re: customer_defined_run_cmds{}
To answer your two questions:
1. Yes you can do this - the great thing about MCSG is that cos large parts of it are based on shell scripts, its easy to change to suit your particular needs. However just because you *can* doesn't mean you *should*. Here's an extract from my MCSG cookbook:
/start quote/
Where Do I Start the Package?
There are two main schools of thought on how to configure application startup and shutdown within a package. These can be broadly summarized as follows:
?? The application is started through a Service. When the service exits because of application failure, starting the service again restarts the application. The customer_defined_run_cmds function in the package control file is left empty.
?? The application is started from a script defined in the customer_defined_run_cmds function in the package control file. Services monitor components of the application, and attempt to restart any failed component before exiting up to the service restart value. Once the service restart value is reached, the monitor just exits rather than attempting a restart, and ServiceGuard handles package failover to another node.
Both of these approaches are equally viable, but I find the second approach to be more flexible, and allow for additional granularity in terms of application components.
/end quote/
2. I think your misunderstaning the test_return function - the 'test_return 51' and 'test_return 52' aren't saying 'test the value of the return code and the value is 51 or 52' The 51 and 52 are used to tell the control script what to do if the value of $? (the return code from the last command is not zero). Take a look further down your control script and you will find this code fragment:
if (( $? != 0 ))
then
case $1 in
/...snip.../
51)
print "\tERROR: Function customer_defined_run_cmds"
print "\tERROR: Failed to RUN customer commands"
halt_services
customer_defined_halt_cmds
disown_dtc
remove_ip_address
umount_fs
deactivate_volume_group
exit 1
;;
52)
print "\tERROR: Function customer_defined_halt_cmds"
print "\tERROR: Failed to HALT customer commands"
exit_value=1
;;
Hope this makes more sense now.
HTH
Duncan
I am an HPE Employee
