Operating System - HP-UX
1833846 Members
2036 Online
110063 Solutions
New Discussion

Shut multiple processes at the same time

 
WW443777
New Member

Shut multiple processes at the same time

Hi all,

I have 2 nodes in a cluster and a package with a lot of processes (around 30) running on one of the nodes. When I'm halting the package with cmhaltpkg it takes around 20 minutes to stop, probably due to many processes waiting to stop one at a time. Is there any way that I can make it stop multiple processes at the same time?

Thanks
7 REPLIES 7
TTr
Honored Contributor

Re: Shut multiple processes at the same time

What kind of processes are these? Are they all from the same environment such as an oracle database? Are they all independent of each other? You can't just go in and start kill processes at will. They need to be gracefully shutdown. And if they are part of the same environment, they may have to be shutdown in a sequence. You need to provide more details about the processes.
WW443777
New Member

Re: Shut multiple processes at the same time

They are all from the same environment. The package I was refering to is an application. This application has individual packages that run some processes each one of them. When one of the package is trying to stop, it waits for all of its processes to stop and then ends succesfully. Meanwhile the other packages are waiting for the previous to stop its processes in order to start their procedure. I was wondering if there is a way to make all the packages stop their child-processes at the same time. There is no dependency issues between the packages.
Torsten.
Acclaimed Contributor

Re: Shut multiple processes at the same time

As long as we talk about an unspecified application probably nobody can really help.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Laurent Menase
Honored Contributor

Re: Shut multiple processes at the same time

you mean something like

listofpid content the list of pid to wait

( sleep 10 ;echo 10) &
listofpid=$!
( sleep 11 ;echo 11) &
listofpid="$listofpid $!"
( sleep 12 ;echo 12) &
listofpid="$listofpid $!"
typeset -i nb=0
for p in $listofpid
do
echo $p
kill -2 $p
while :
do
kill -0 $p 2>/dev/null && break
sleep 1
done &
nb=nb+1
echo $nb
done

echo
wait
TTr
Honored Contributor

Re: Shut multiple processes at the same time

> When one of the package is trying to stop, it waits for all of its processes to stop and then ends succesfully

That would be the normal way to stop "a package".

> Meanwhile the other packages...

It depends. Are these packages independent of one another? And do you have separate shutdown scripts for *each* package that are run in sequence?

If each package is independent of the others, you should be able to run the shutdown process for each package separately. There may be an impact to the server when all these are shutting down - there are probably doing a lot of processing and i/o during shutdown but that can be tested.
But you are still not providing enough details.
WW443777
New Member

Re: Shut multiple processes at the same time

Sorry for the inconvenience I'm causing but I'm new to hp-ux and maybe I don't get exactly what kind of info you need me to provide... Pls can you make a list so as to be clear for me and you can give me a clear answer?? Thanks and sorry again
TTr
Honored Contributor

Re: Shut multiple processes at the same time

You can start by telling us which "package" is this. Someone here may know this package in detail.

Also, you mentioned while the first package is shutting down and the others are waiting...

Well, this shutdown script that halts the packages in sequence, can it be broken down into several halt scripts, one shutdown script for each package? If these packages are not dependent on each other, maybe you can schedule separate shutdown scripts to run at the same time.