Killing process left running from aborted job
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 62
- Joined: Wed Dec 08, 2004 2:26 am
Killing process left running from aborted job
Hi All,
How to kill a process using Unix.
I need to kill the process for the aborted job without using the Datastage Director.
Thanks in Advance
SAS
How to kill a process using Unix.
I need to kill the process for the aborted job without using the Datastage Director.
Thanks in Advance
SAS
Hi,
Usually you would like to do this using the director or the DS.TOOLS interface from the universe command line.
If you insist using unix command line you will kill the process but might not release DS locks and such.
I will use the unix kill command as a last resort starting with kill -15 then -13 then -11 and finally -9 (the last option -9 kills immidiatly without giving the process any chance to cleanup after itself) and the process id of the process you want to kill.
Bare in mind you usually have permissions to do this to jobs owned by the user you logged in under unless you are the administrative user (root).
I strongly recomend you consult this issue with your sysadmin guys, and undestand the implications of using this command before you use it.
P.S.
please update the DS version and OS related info of your post.
IHTH,
Usually you would like to do this using the director or the DS.TOOLS interface from the universe command line.
If you insist using unix command line you will kill the process but might not release DS locks and such.
I will use the unix kill command as a last resort starting with kill -15 then -13 then -11 and finally -9 (the last option -9 kills immidiatly without giving the process any chance to cleanup after itself) and the process id of the process you want to kill.
Bare in mind you usually have permissions to do this to jobs owned by the user you logged in under unless you are the administrative user (root).
I strongly recomend you consult this issue with your sysadmin guys, and undestand the implications of using this command before you use it.
P.S.
please update the DS version and OS related info of your post.
IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Hi Sasi,
When you want to kill a process/job first you have to find out the process ID which are currently running on datastage server
I would like to prefer to connect to your server via telnet with your ID
and then use ps -ef command
which gives the current processes which are running on your server by that you can find out the process ID
then kill your ID based on kill command
When you want to kill a process/job first you have to find out the process ID which are currently running on datastage server
I would like to prefer to connect to your server via telnet with your ID
and then use ps -ef command
which gives the current processes which are running on your server by that you can find out the process ID
then kill your ID based on kill command
when you are using ps -ef command that give output as
UID PID PPID C STIME TTY TIME CMD
root 1515 1 0 May 08 ? 0:00 /dstage/app/DataStage/DSEngine/bin/dsrpcd
dsadm 1984 1515 0 10:17:36 ? 0:00 dscs 4 3600 0
dsadm 1985 1984 0 10:17:36 ? 0:03 dsapi_slave 7 6 0
dsadm 2102 1515 0 May 08 ? 0:00 dscs 4 3600 0
dsadm 2103 2102 0 May 08 ? 0:03 dsapi_slave 7 6 0
then you can kill the procee which you want
We can kill the processes that got left behind. This usually happens if there is a network problem or if the client hangs and is terminated. You can specify multiple Process IDs (PID) on one "kill -9" command.
$kill -9 1984 1985 2102 2103
but first of all I won't prefer kill -9 command. because this is very dangerous command.
UID PID PPID C STIME TTY TIME CMD
root 1515 1 0 May 08 ? 0:00 /dstage/app/DataStage/DSEngine/bin/dsrpcd
dsadm 1984 1515 0 10:17:36 ? 0:00 dscs 4 3600 0
dsadm 1985 1984 0 10:17:36 ? 0:03 dsapi_slave 7 6 0
dsadm 2102 1515 0 May 08 ? 0:00 dscs 4 3600 0
dsadm 2103 2102 0 May 08 ? 0:03 dsapi_slave 7 6 0
then you can kill the procee which you want
We can kill the processes that got left behind. This usually happens if there is a network problem or if the client hangs and is terminated. You can specify multiple Process IDs (PID) on one "kill -9" command.
$kill -9 1984 1985 2102 2103
but first of all I won't prefer kill -9 command. because this is very dangerous command.
Well, then don't use it in your example. Many people will just look at an example and run with it without reading any of the dire warning that follow.venkat n wrote:but first of all I won't prefer kill -9 command. because this is very dangerous command.
Also, if one wants to kill off leftover running job processes - you should be looking for phantom processes on the server. The dscs and dsapi_slave processes are client connections and you could be needlessly blowing others (or even yourself) out of the water!
Code: Select all
ps -ef |grep phantom |grep -v grep
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Warning!!
A job consists of more than one process. For server jobs there is one process (executing DSD.RUN) controlling the job and zero or more other processes (executing DSD.StageRun) which are child processes of the controlling process. Find and kill any child processes before killing the controlling process, lest you create UNIX zombie processes (which are very hard to kill!).
A job consists of more than one process. For server jobs there is one process (executing DSD.RUN) controlling the job and zero or more other processes (executing DSD.StageRun) which are child processes of the controlling process. Find and kill any child processes before killing the controlling process, lest you create UNIX zombie processes (which are very hard to kill!).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Hi Ray !
This doesn't seem to get rid of phantom processes.
I have 110 phantom processes, and I have run this command abt 1/2 hr back, still the processes remain.
In the director, the entries for these phantom processes have the LastCommandProcessed as " DSD.OnAbort"
Is there any other way to get rid of these phantoms (other than kill -9 option)?
-Nagesh
Code: Select all
$DSHOME/bin/dsdlockd -p
This doesn't seem to get rid of phantom processes.
I have 110 phantom processes, and I have run this command abt 1/2 hr back, still the processes remain.
In the director, the entries for these phantom processes have the LastCommandProcessed as " DSD.OnAbort"
Is there any other way to get rid of these phantoms (other than kill -9 option)?
-Nagesh
dsdlockd can be used only for those process which are left orphaned.
For those one which are active need to be first stopped from Director.
Resource Cleanup, Clear Status, DS.TOOLS from TCL, Kill can be followed.
For those one which are active need to be first stopped from Director.
Resource Cleanup, Clear Status, DS.TOOLS from TCL, Kill can be followed.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Hi Kumar,
If we call a process which doesnt have any parent process (ie., having Parent process as 1) as an orphaned process, then all the 110 odd phantoms are orphaned.
This process from March 1st should have been taken care by dsdlockd, but it is not the case.
Any clues ??
If we call a process which doesnt have any parent process (ie., having Parent process as 1) as an orphaned process, then all the 110 odd phantoms are orphaned.
Code: Select all
nagesh 1076 1 0 Mar 01 ? 0:01 phantom DSD.StageRun SRQCGenerator.HTB SRQCGenerator.Transform 299 0/50/1
This process from March 1st should have been taken care by dsdlockd, but it is not the case.
Any clues ??
What is the value of dsdlockd.config that avialble in $DSHOME?
Try configure the Timerto 900, it should pretty much take care automatically.
If that was set properly and if you still find many process left orphaned, close all the Datastage session and ensure there is not locks held by any clients. This can be easily found from "CleanUp Resources" option available in Director. Operate with dsadm, to clear any locks.
You can kill the rest of the process. Periodic restart of server would also take care of all these.
Try configure the Timerto 900, it should pretty much take care automatically.
If that was set properly and if you still find many process left orphaned, close all the Datastage session and ensure there is not locks held by any clients. This can be easily found from "CleanUp Resources" option available in Director. Operate with dsadm, to clear any locks.
You can kill the rest of the process. Periodic restart of server would also take care of all these.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'