GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: MC/SG package script
Operating System - HP-UX
1847391
Members
2723
Online
110264
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
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
09-30-2002 08:58 AM
09-30-2002 08:58 AM
MC/SG package script
I have an app and it is running within my package where I want to bring down this app's processes down simultaneously. I have used a for loop to read in each site's config file, but it is not working! Can anyone help?
thanks
derek
thanks
derek
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2002 09:36 AM
09-30-2002 09:36 AM
Re: MC/SG package script
Derek: I suspect that we can provide some guidance, but you haven't given us very much to go on. It would let us help you, if you would go into a bit more detail.
Ordinarily, a package runs its control script, which starts and stops the app(s) by running an external command or script. You seem to be doing this, you mention a 'for loop' you are trying to use.
Does the script with the for loop work OK outside of the package? This can be difficult to confirm, since the package also activates and deactivates the VG used by the package, but manual activation of the VG to try your start/stop scripts is a normal part of MC/SG troubleshooting.
You want to bring down the app's processes simultaneously, and you mention multiple sites. Do you mean that you have this app running, in a package, at several sites, and that you want to stop all the apps simultaneously at the various sites? How would this be controlled, do you mean that, if any of the apps is stopped, the others should also stop immediately?
As in all Unix stuff, there are a dozen ways to do something, six of which are decent, and a couple of which are ideal. I'm sure that we can make some suggestions, if you will get more detailed.
We need: OS version, how are the sites connected, what exactly are you trying to do, and, a copy of the script that "doesn't work" would be useful.
Take Heart, the truth is out there somewhere.
Regards, --bmr
Ordinarily, a package runs its control script, which starts and stops the app(s) by running an external command or script. You seem to be doing this, you mention a 'for loop' you are trying to use.
Does the script with the for loop work OK outside of the package? This can be difficult to confirm, since the package also activates and deactivates the VG used by the package, but manual activation of the VG to try your start/stop scripts is a normal part of MC/SG troubleshooting.
You want to bring down the app's processes simultaneously, and you mention multiple sites. Do you mean that you have this app running, in a package, at several sites, and that you want to stop all the apps simultaneously at the various sites? How would this be controlled, do you mean that, if any of the apps is stopped, the others should also stop immediately?
As in all Unix stuff, there are a dozen ways to do something, six of which are decent, and a couple of which are ideal. I'm sure that we can make some suggestions, if you will get more detailed.
We need: OS version, how are the sites connected, what exactly are you trying to do, and, a copy of the script that "doesn't work" would be useful.
Take Heart, the truth is out there somewhere.
Regards, --bmr
We must indeed all hang together, or, most assuredly, we shall all hang separately. (Benjamin Franklin)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2002 09:47 AM
09-30-2002 09:47 AM
Re: MC/SG package script
Derek,
A couple of things. What do you mean when you say it is not working? Is the script failing? Is it not shutting down some sites?
Looking at your script, as it is setup now it will only go through the loop once.
You set SITELIST to one site, then do a for on $SITELIST.
Is this simply as a test, or is this the finished script?
What I do is put my sites in a file the do
for $SITE in `cat /dir/to/file/sites`
do
.
.
.
done
A couple of things. What do you mean when you say it is not working? Is the script failing? Is it not shutting down some sites?
Looking at your script, as it is setup now it will only go through the loop once.
You set SITELIST to one site, then do a for on $SITELIST.
Is this simply as a test, or is this the finished script?
What I do is put my sites in a file the do
for $SITE in `cat /dir/to/file/sites`
do
.
.
.
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2002 06:44 AM
10-01-2002 06:44 AM
Re: MC/SG package script
Sorry, Derek, didn't see the attachment earlier.
Some suggestions and questions:
1> Sean's response may help, and deserves some points. It may be that the single entry "hboctest" is for a server in your test environment, though, in which case it is OK as it is.
2> A few lines down is a line that says # set -x. If you remove the comment (# character), this should give a more verbose output when the script is run. That might help troubleshoot this.
3> What do you mean "not working"? Does it fail somewhere? Does it run, but fail to shut down the processes? Does it provide any output at all? What is the error message?
4> If the for loop only works once, and that is the problem, then Sean may have nailed it -- you aren't setting SITELIST to a list, only to a single entry.
5> If the problem you are having is further down in the script, well, there are several other scripts called (hcisetenv, setroot, setsite, etc). Do you know if they are working right, setting the variables, etc? you may need "echo" statements after each to make sure that they have done what you expect, back in this script.
6> If this script shuts down each 'site' in the 'SITELIST' and there are multiple sites, it doesn't seem compatible with MC/SG, which would need to have the 'cmhaltpkg -n ' command run at each site to halt the package itself. In other words, once an app is packaged into MC/SG, you just do the above command, and IT runs the shutdown script as a part of its function.
If you were trying to run this script on multiple nodes in one or more clusters, you would use this script (or one like it) as the "customer halt commands" script in your package control file, and your master shutdown script would do something like
remsh /usr/sbin/cmhaltpkg
with a line for each server/node on which you wanted to have this package halted. You could parse the output of 'cmviewcl' to see if the packages had stopped, once again using 'remsh' or whatever inter-system command launcher that suits your environment (ssh, etc).
Hope this helps, good luck!
--bmr
Some suggestions and questions:
1> Sean's response may help, and deserves some points. It may be that the single entry "hboctest" is for a server in your test environment, though, in which case it is OK as it is.
2> A few lines down is a line that says # set -x. If you remove the comment (# character), this should give a more verbose output when the script is run. That might help troubleshoot this.
3> What do you mean "not working"? Does it fail somewhere? Does it run, but fail to shut down the processes? Does it provide any output at all? What is the error message?
4> If the for loop only works once, and that is the problem, then Sean may have nailed it -- you aren't setting SITELIST to a list, only to a single entry.
5> If the problem you are having is further down in the script, well, there are several other scripts called (hcisetenv, setroot, setsite, etc). Do you know if they are working right, setting the variables, etc? you may need "echo" statements after each to make sure that they have done what you expect, back in this script.
6> If this script shuts down each 'site' in the 'SITELIST' and there are multiple sites, it doesn't seem compatible with MC/SG, which would need to have the 'cmhaltpkg -n
If you were trying to run this script on multiple nodes in one or more clusters, you would use this script (or one like it) as the "customer halt commands" script in your package control file, and your master shutdown script would do something like
remsh
with a line for each server/node on which you wanted to have this package halted. You could parse the output of 'cmviewcl' to see if the packages had stopped, once again using 'remsh' or whatever inter-system command launcher that suits your environment (ssh, etc).
Hope this helps, good luck!
--bmr
We must indeed all hang together, or, most assuredly, we shall all hang separately. (Benjamin Franklin)
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 2026 Hewlett Packard Enterprise Development LP