Process Killed : Need to find why ?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Process Killed : Need to find why ?
# 1  
Old 05-17-2011
Process Killed : Need to find why ?

Hi reader,

I'm making a tool out of korn shell script that is running on a HP-UX server. But everytime i invoke the tool, it gets killed after a while (mid-process). I have tried re-running it a couple of times but each invocation ending up the same way ..

following is a snippet of the o/p i get when the scripts runs :

-------------------------------------------------------------------
. . .

2) FTP-ing all files to remote exceed :
> FTP initiated to : 47.103.130.35
The files will be copied to NODATA_smtxv19bk_17_May_2011_13:18:45 on remote exceed
This may take a while...please wait
..........................................................................................
.............................................
/home/casa/clakkad/bin/one_shot_build.sh[1015]: 7177 Killed

-----------------------------------------------------------------------
The line in bold is the sys generated error , rest is all from the script.

I need to find out if there is any way i can find out why the process is being killed ?Smilie any log that is generated when system kills a process or something!!

Will realy appreciate any help/lead that i can get

thanks already Smilie

Chinmayee
# 2  
Old 05-17-2011
Could you please post the script
# 3  
Old 05-19-2011
sure the ftp server on one side is timing you out most likely. check your ftp config on both sending and receiveing sides
# 4  
Old 05-20-2011
no, i had already checked if FTP was being timed-out.. but not so. Just as soon as the FTP completed the process used to die.

I was transfering a big file to the other end.. could this be a problem ? As in the process being too resource intensive, the server chose to close it.

I'm actually only looking for a way to find the reason behind the closure so that i can somehow prevent its cause from the script. Is there any log that is generated when a process gets killed ?
# 5  
Old 05-20-2011
Quote:
/home/casa/clakkad/bin/one_shot_build.sh[1015]: 7177 Killed
It's the script which is being killed.
I'd look for a "kill" command within the script itself or failing that some sort of process clean-up cron which is killing the script after a certain period of time.


(There is no timeout as such with HP-UX "ftp". It can be implemented by backgrounding the "ftp" and then killing the "ftp" process if it takes too long.
That is not what has happened here.)
# 6  
Old 05-20-2011
If I remember correctly, as it's been a couple of decades, when a process is killed it is returned via the common register. If you don't have access to this return code, as most who aren't coding in assembly are, then you will most likely have to hunt down the global variable that is assigned the failure code.

It seemed to me that we had that problem and one of the script wizards just made some kind of global variable before it was spawned and when it was killed that error was found there. If my memory serves this is documented in the whatever mechanism that you spawn it by. If you follow. I know it returns or places that return error in a bucket, but I can't remember if we passed it or just had to make a known global variable.

Best of luck, please tell us and I will hunt for it when I get a chance.
# 7  
Old 05-21-2011
global variable! great... i will try and track it down. but i would appreciate help as well, cause i dont know scripting that well to know which variable to look for .

btw, if it helps , this FTP is being implemented through an EXPECT script which is being invoked from an hierarchy of ...lets say.. parent scripts. The orde is something like :

script 1 > script 2 > script 3 > ftp script.

here the script being killed is 'script 1'. perhaps so many sub-shell invocations is causing the problem and as suggested previously by methyl a process clean-up cron mighth be killing the main script. But i ran the same tool (scripts) on another HP-UX server and it didnt get killed and worked to completion.

This is a resource shortage or something issue!! then again i have find a way like the global var thing to try and prevent this.

PS :-
the above may not exactly be a good coding style what with so many sub-shell invocations but thats how i have worked it out for now.

thank you all Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Capturing the killed process logs

I have two set of questions. 1) To skip killing some process automatically. 2) To kill other process and capture their log. I have set of process, some needs to be killed gracefully and others should be skipped. Listed are the process. adm 1522... (1 Reply)
Discussion started by: murali1687
1 Replies

2. Shell Programming and Scripting

how to prevent process from being killed

Hi,all.Well,I know someone has already asked this question before,however,It's too long before.So i post a new thread here. Here is the issue.I have a shell script that use awk to calculate something and the script takes about 15 mins,it will use 100% CPU,and the system automatically killed the... (2 Replies)
Discussion started by: homeboy
2 Replies

3. UNIX for Dummies Questions & Answers

Protect a Process from Being Killed

Hi, I have a process which takes 13-15 mins for execution and its getting killed in the meantime.So can you please helpme out how to protect the process from getting killed. Thanks in advance. Regards, Harika (9 Replies)
Discussion started by: harikagrp
9 Replies

4. UNIX for Dummies Questions & Answers

SAS Process Getting Killed

HI all, I am very new to AIX (matter of fact Unix). We are currently automating out manual process using Unix Shell Scripting. My wrote a shell script which will accept the name of the sas job as parameter, checks the existense of the sas file in the specified folder. If it is not present,... (1 Reply)
Discussion started by: anubhav2020
1 Replies

5. Solaris

LDAP process getting killed

Hi all, Currently I am using LDAP to store some network related data, When I run following script ./ns-slapd ldif2db Execution of above script terminates displaying "Killed" on the console. As far as I know, a process can be killed by two ways- 1. manually running " kill -9 <PID of LDAP... (1 Reply)
Discussion started by: akash_mahakode
1 Replies

6. Shell Programming and Scripting

Sybase Process Killed - How to identify

I have this shell script and in case the sybase process is been killed how can identify whether the process was killed or not, as the error code always returns 0. #!/bin/sh isql -S SERVER -U user -P pass<<TOP select * from tableName go TOP echo $? (2 Replies)
Discussion started by: dinjo_jo
2 Replies

7. Solaris

how to run a killed process

hi, i am creating a daemon process for updating the file at regular interval.one problem with this is if anybody kills the daemon it wont update the file.anybody have idea how to rerun the daemon if it killed.the code is written in c++ in solaries environment. thnaks & regards suresh (8 Replies)
Discussion started by: suresh_rtp
8 Replies

8. Programming

how to delay a process from getting killed

We are forking a process B from process A and the process B should display the details it reads from process C(daemon process) continuously. Let us say that the process C sents 100 packets.The process B receives all the 100 packets from the process C before it prints all details of 31... (1 Reply)
Discussion started by: cijkmysj
1 Replies

9. UNIX for Dummies Questions & Answers

Who is the parent of a killed process ?

Suppose we have the following process tree: init-> ProcessA->processB->processC then I kill processB Who is the parent of the processC? init or the processA (6 Replies)
Discussion started by: Puntino
6 Replies

10. UNIX for Dummies Questions & Answers

process not getting killed

I have a process that is in the sleeping state "S" and I have tried to stop it with a run control script that I use to stop/start it - but it does not stop. I have tried kill -9 <PID of process> with no change. I imagine that this process is sleeping with the kernel. It does not respond to... (5 Replies)
Discussion started by: finster
5 Replies
Login or Register to Ask a Question