- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to get and set a signal mask within an unix sc...
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
11-26-2001 09:47 AM
11-26-2001 09:47 AM
How to get and set a signal mask within an unix script.
I am having a big trouble within a MC-SG control script.
It looks like MC-SG has masked a signal used by Oracle and HP-OV...
==> Oracle shutdown, OV startup hang.
My questions are:
1. Does anyone know how to get within a shell the signal mask?
2. How can I set a new signal mask within a shell?
Any help is apreciated,
TIA,
Kind Regards,
Rui.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2001 09:49 AM
11-26-2001 09:49 AM
Re: How to get and set a signal mask within an unix script.
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2001 09:52 AM
11-26-2001 09:52 AM
Re: How to get and set a signal mask within an unix script.
What is it that you are trying to do. We have oracle databases running on MC/SG with no problem at all. I was once configuring Omniback with SG, but then dropped the idea as we were moving to netbackup. There should be no problem with oracle integration with MC/SG. Have you spoken to hp support regarding this. They have a seperate team which tried to resolve all SG issues. Look for some of the team members names in the SG section. You'll find some of the posts from those team members. I remeber Stephen Doud to be one from that team.
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2001 09:54 AM
11-26-2001 09:54 AM
Re: How to get and set a signal mask within an unix script.
forgot to mention one thing. When you post a question in the forum, do make sure you are using the right sub category. I feel this question of yours should have been posted in the SG category and not in general.
Thanks & Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2001 10:11 AM
11-26-2001 10:11 AM
Re: How to get and set a signal mask within an unix script.
I have already opened a call to HP with this problem...
But I am trying to find out a turnaround solution..
If a given signal is masked by and application any child process will never catch it (smon is never getting a signal to accomplish oracle shutdown).
My question is how to check and reset this mask so that the applications started within my script work correctly...
TIA,
Kind Regards,
Rui.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2001 10:16 AM
11-26-2001 10:16 AM
Re: How to get and set a signal mask within an unix script.
From what i understand, you are able to start the database with the SG script, but unable to shutdown the same. You can try this, do remember that the package will be failed over, if you are monitoring the oracle processes.
Start the package, let the database start with that. Login into the system as oracle and do a database shutdown manually using svrmgrl. If this works fine, you should be able to shutdown the database using the package shutdown script also. Can you post your control script and the dbstart and dbshut scripts for us to look at.
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2001 10:32 AM
11-26-2001 10:32 AM
Re: How to get and set a signal mask within an unix script.
Oracle is monitoring is not activated yet.
Outside my control.sh script, Oracle shutdown works (as user oracle..)...
Within the script it hangs!
Within my control script I do:
...
/etc/cmcluster/pkg_sys_db/mon_dbs.sh shutdown
...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2001 10:58 AM
11-26-2001 10:58 AM
Re: How to get and set a signal mask within an unix script.
Use "su - oracle -c ...." inplace of "su oracle -c ...." in your control file and try.
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2001 11:04 AM
11-26-2001 11:04 AM
Re: How to get and set a signal mask within an unix script.
Note: with su -, I am not able to pass ORACLE_SID to my script...
I tried to put dbshut (which reads the SID in oratab)... and it hangs...
Thanks,
Rui.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2001 11:30 AM
11-26-2001 11:30 AM
Re: How to get and set a signal mask within an unix script.
trap "echo trap 2 or 3 seen" 2 3
So every time signals 1 2 or 3 (also known as kill signals) are sent to this script, it will just echo the message and continue on. Here's a sample script:
#!/usr/bin/sh
trap "echo Trap 2 3 or 15 seen" 2 3 15
while :
do
sleep 1
done
Run the script and from another session, issue kill commands -2 -3 or -15 and you'll see the program detect them. Use kill -1 to terminal the script (CTRL-C won't work as it is kill -15)
As for Oracle ignoring the signal(s), IF the signal was sent to an Oracle process, then the process is ignoring the signal and would have to be rewritten and recompiled to fix the problem. If the signal is being sent to a parent process, same requirement.
If the parent process is a shell script, make sure the script is using trap correctly. If no traps are in the script, does the script get started as an su login? Aha! Is the logfile full of login junk like the copyright message? This means that /etc/profile and .profile need some work.
Start by looking at /etc/profile: is there a trap command? If yes, is there a second? HP standard /etc/profile has two and they MUST exist in a pair:
trap "" 1 2 3
trap 1 2 3
If the second trap is missing (some sysadmins remove because it looks redundant) then subsequent activities spawned by the login shell will no longer respond to traps 1 2 or 3. The first statement: trap "" 1 2 3 means: do nothing if these traps are seen. The second statement: trap 1 2 3 will reanable standard behavior.
So make sure that all traps starting at the highest level are set and reset as required.
BTW: To fix all that extra login junk (including "not a typewriter' error messages, any command in a script that is interactive or terminal-based must be skipped when there is no terminal (such as cron jobs or start/stop scripts). The usual suspects are: tabs ttytype tput and of course: cat /etc/copyright.
In /etc/profile (and .profile if needed), test for interactive with:
if [ -o interactive ]
then
...do things like tput or tabs or cat /etc/copyright
fi
Now the interactive commands will only be run when there is a true interactive terminal in control of the session.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2001 11:36 AM
11-26-2001 11:36 AM
Re: How to get and set a signal mask within an unix script.
Try to call a script using su - oracle -c "ora_shutdown_script" and customize this script to passon the Oracle SID value to the shutdown program. We have multiple oracle datbases on same system with SG and we haev customised the dbshut script shutdown all the datbases. We just have to call this dhshut script from the SG control script.
Use the same steps in dbshut that you are using in control script for SG to shutdown the two datbases. Do a export of ORA_SID one by one and then do a shutdown for individual databases.
Why don't you try the whole operation with a single database and once you are successful with shutting down a single database with SG control script, you'll have some less steps to worry about. don't try to manipulate all the datbases at the same time. Take one at a time.
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2001 10:34 AM
11-30-2001 10:34 AM
Re: How to get and set a signal mask within an unix script.
First of all thanks to all who tried to help me in the solution of this problem...
I got the final solution from the HP support. Just for the record, here is it:
1. create program to set a new mask:
#include
#include
main(int argc, char **argv)
{
sigsetmask(0L);
execvp(argv[1], &argv[1]);
perror("execvp");
}
and call OV/oracle with it:
/dir/.../nome_pgm $OV_BIN/ovstart
2. Apply patch: PHSS_24537
Note: the patch solved the problem.
Regards & many thanks,
Rui.