Auto kill the applications
Hi,
I have some binaries runing on my server. I want to make a script to kill the binaries. Kindly help. Regards Shekhar |
Quote:
BTW You can use kill and pkill command. Code:
# kill signal PID 9=KILL 15=TERMINATE for more signals Code:
man 7 signal |
Thanks for information ,
now i can kill the application through process name using pkill command but how to get the exact process name of my application. |
Hi,
Get the name of binaries first ps -ef | grep -i "binary name" once you get the pid of that kill it kill -9 pid or killall processname |
You can also use killall to kill all processes related to a certain name, like so:
Code:
killall -SEGV process_name |
Hi ,
This way using process id i am able to kill the applications but my main purpose was to automate it, instead of searching for PID and killing it, i just wanted to kill all the application in one go. Eg. i have 4 applications runing. 1- a.sh 2- b.sh 3- c.sh 4 -d.sh now i will write and application that will kill these 4 applications. i dont know service name of my applications when i try to get service name using pgrep -l a.sh then there is no output. please help. |
Application or your service is shell script?
|
Find below output of grep command for my application.
[root@imi dump]# ps aux|grep imiusr root 8112 0.0 0.0 61160 744 pts/4 S+ 15:52 0:00 grep imiusr root 12279 0.0 0.0 63844 1120 ? S Sep14 0:00 sh imiusr.sh root 12280 0.0 1.2 1482284 103232 ? Sl Sep14 2:28 /usr/java/jdk1.6.0_18/bin/java -Xmx1024m -Djava.rmi.server.hostname=172.16.66.37 -jar /app/provisionmonitor/imiusr/libs/imiusr.jar /app/provisionmonitor/imiusr/config/imiusr.properties /app/provisionmonitor/imiusr/config/log4j.properties 9999 Now i want to kill this application by service name. |
All times are GMT -5. The time now is 07:35 AM. |