- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Sending a HUP signal to process doesnt work on...
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
Discussions
Discussions
Forums
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
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
тАО04-16-2009 01:50 AM
тАО04-16-2009 01:50 AM
Sending a HUP signal to process doesnt work on HP-IA
below is the scripts for your information
#!/bin/sh
# sig_reorgdb.sh
set -x
. sig_Scripts.sh
#reorgdb is the database utility process
dbUtil=reorgdb
dbName=$1
signal1="INT QUIT TERM HUP USR1 USR2"
sigTstp=TSTP
# Calculation of Runtime : Reorgdb
expected_time=`get_expected_seconds reorgdb $dbName`
sleepTime=`expr $expected_time / 2`
for sig1 in $signal1
do
# We break out from the following retry loop as soon as we get
# a valid test result.
got_valid_test_run=0
until [ $got_valid_test_run -eq 1 ]
do
restore $dbName
# use very low max_page_buffs to make reorgdb run longer
chk stopdb $dbName
setup_db -update -add_be max_page_buffs 10 -db $dbName
if [ $sig1 = "INT" -o $sig1 = "QUIT" ]; then
genSignal $sig1 $sleepTime $dbUtil ${dbName}${AT}
else
genSuspSig $sig1 $sigTstp $sleepTime $dbUtil ${dbName}${AT}
fi
# If the setdbid process finished before genSignal() had a chance
# to send signal then we need to start this testcase from the top
if test -f process_finished_too_fast
then
# Also since sleep time was apparently too long
# let's reduce it.
if [ "$sleepTime" -gt 1 ]
then
sleepTime=`expr $sleepTime - 1`
fi
rm process_finished_too_fast
continue
fi
# wait for reorgdb to finish (if it's still running)
wait $pid
echo $?
...........................................
#!/bin/sh
#sig_Scripts.sh
get_expected_seconds()
{
rm -f _secs.tmp
if [ `uname` = "Linux" ]
then
/usr/bin/time -p $* > _secs.tmp 2>&1
else
/usr/bin/time $* > _secs.tmp 2>&1
fi
if [ `uname` = "AIX" ]
then
awk '/Real/ {print $2}' _secs.tmp | awk -F. '{print $1}'
else
awk '/real/ {print $2}' _secs.tmp | awk -F. '{print $1}'
fi
}
# Usage : Signal SigType sleepTime commandToBeExectuted
genSignal()
{
if [ `uname` = "Linux" ]
then
KILL=/bin/kill
else
KILL=/usr/bin/kill
fi
sigType1=$1
shift
sleepTime=$1
shift
$* &
pid=$!
if [ $sleepTime -eq 0 ]; then
sig_msleep.exe 60
else
sleep $sleepTime
fi
if $KILL -${sigType1} $pid
then
return 0
else
echo "Test Error: kill failed -- Target process may have finished before kill was run "
touch process_finished_too_fast
return 1
fi
}
genSuspSig()
{
sigType2=$1
shift
genSignal $*
if $KILL -${sigType2} $pid
then
return 0
else
echo "Test Error: kill failed -- Target process may have finished before kill was run "
touch process_finished_too_fast
return 1
fi
}
...........................................
when i removed HUP from signal1="INT QUIT TERM HUP USR1 USR2" this scripts work fine.
So the question is when we send a HUP signal
why this script fails?
Does HUP signal behave differently on HP-IA?
Below is the log of the scripts:
..
..
..
..
+ [ HUP = INT -o HUP = QUIT ]
+ genSuspSig HUP TSTP 0 reorgdb tdbrD0gxPDB1util_sig_reorgdb
+ test -f process_finished_too_fast
+ wait 20292
after this its not going ahead as reorgdb process got the signal HUP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2009 02:13 AM
тАО04-16-2009 02:13 AM
Re: Sending a HUP signal to process doesnt work on HP-IA
It seems if it is stuck on wait, it's because the signal was handled and the process wasn't killed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2009 02:26 AM
тАО04-16-2009 02:26 AM
Re: Sending a HUP signal to process doesnt work on HP-IA
It seems if it is stuck on wait, it's because the signal was handled and the process wasn't killed.
yes,it it stuck on wait but only in case of HP-IA.On other platform scripts going ahead.
Also after running the script if I grep for that process id ,process was not running.
It means process was killed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2009 02:36 AM
тАО04-16-2009 02:36 AM
Re: Sending a HUP signal to process doesnt work on HP-IA
What other platforms? Any HP-UX ones on at least 11.23?
>if I grep for that process id, process was not running. It means process was killed
Yes. It shouldn't wait for that.
Can you add a "ps -fp $pid" before that wait?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2009 03:14 AM
тАО04-16-2009 03:14 AM
Re: Sending a HUP signal to process doesnt work on HP-IA
other platforms are AIX,Solaris,Linux
>Can you add a "ps -fp $pid" before that wait?
Can you please tell me the reason for adding
"ps -fp $pid" before wait
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2009 03:22 AM
тАО04-16-2009 03:22 AM
Re: Sending a HUP signal to process doesnt work on HP-IA
(So they aren't HP-UX and your HP-IA is a typo.)
>Can you please tell me the reason for adding
"ps -fp $pid" before wait
To prove whether that process didn't exist when it did the wait. We are still debugging, this isn't a fix.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2009 09:15 PM
тАО04-16-2009 09:15 PM
Re: Sending a HUP signal to process doesnt work on HP-IA
Below is the log of the scripts having
"ps -fp $pid" before wait
..
..
..
+ [ HUP = INT -o HUP = QUIT ]
+ genSuspSig HUP TSTP 0 reorgdb tdblwlrGPDB1util_sig_reorgdb
+ test -f process_finished_too_fast
+ ps -fp 5870
UID PID PPID C STIME TTY TIME COMMAND
+ wait 5870
+ echo 129
129
+ chkReorgdb
stopdb -f tdblwlrGPDB1util_sig_reorgdb
VERSANT Utility STOPDB Version 8.0.0.0
Copyright (c) 1988-2009 VERSANT Corporation
..
..
..
After adding "ps -fp $pid ", scripts is not getting stuck in wait and works fine.
Also if you see the log o/p of ps -fp $pid shows that process(reorgdb) didnt exist.
Though "ps -fp $pid" is not a fix ,scripts works. Strange
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2009 10:32 PM
тАО04-16-2009 10:32 PM
Re: Sending a HUP signal to process doesnt work on HP-IA
Yes, strange. Perhaps it just takes time for the process to die, longer than the time from kill to the wait?
In any case, if you know you killed it, why bother with the wait?