Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
08-23-2012, 09:25 AM
|
#1
|
Member
Registered: May 2011
Posts: 194
Rep: 
|
killing a process
Hi all,
trying to kill a process, tried both kill and kill -9 but no use...
Code:
# ps -ef|grep db
root 8454280 1 0 Aug 17 - 0:14 /opt/tivoli/tsm/db2/bin/db2fmcd
# kill 8454280
# echo $?
0
# ps -ef|grep db
root 8454282 1 0 09:42:19 - 0:00 /opt/tivoli/tsm/db2/bin/db2fmcd
and then tried
# kill -9 8454282
# echo $?
0
# ps -ef|grep db
root 8454284 1 0 10:18:31 - 0:00 /opt/tivoli/tsm/db2/bin/db2fmcd
The process is still there ? any other way other than reboot ?
|
|
|
08-23-2012, 09:29 AM
|
#2
|
Member
Registered: Aug 2012
Location: /home/byannoni
Distribution: Arch
Posts: 128
Rep:
|
Code:
kill -9 `pidof db2fmcd`
|
|
|
08-23-2012, 09:30 AM
|
#3
|
Member
Registered: May 2009
Location: Milan, Italy
Distribution: Ubuntu, Debian, Fedora, Oracle Linux
Posts: 109
Rep:
|
May Tivoli has an auto restart mechanism, it a monitor indeed :-)
Is there a tivoli root process? May if you kill that you solve ...
|
|
|
08-23-2012, 09:34 AM
|
#4
|
Member
Registered: May 2011
Posts: 194
Original Poster
Rep: 
|
@byannoni: i did use kill -9 pid but no use
@MCD555: tivoli is not currently running on this server
Code:
# ps -ef|grep tsm
root 8454284 1 0 10:18:31 - 0:00 /opt/tivoli/tsm/db2/bin/db2fmcd
root 9830424 9961716 0 10:33:32 pts/0 0:00 grep tsm
#
# ps -ef|grep dsm
root 9830426 9961716 0 10:33:40 pts/0 0:00 grep dsm
#
|
|
|
08-23-2012, 09:43 AM
|
#5
|
Member
Registered: May 2009
Location: Milan, Italy
Distribution: Ubuntu, Debian, Fedora, Oracle Linux
Posts: 109
Rep:
|
Have you monit configured on your machine?
Sorry if this question sound stupid!?
|
|
|
08-23-2012, 09:45 AM
|
#6
|
Member
Registered: Aug 2012
Location: /home/byannoni
Distribution: Arch
Posts: 128
Rep:
|
Maybe this will work better:
Code:
kill -9 `pidof /opt/tivoli/tsm/db2/bin/db2fmcd`
|
|
|
08-23-2012, 09:50 AM
|
#7
|
Member
Registered: May 2011
Posts: 194
Original Poster
Rep: 
|
@MCD555: Not sure what 'monit configured' is ?
@byannoni: you mean to copy and paste all of your code on command line ? as it is kill -9 `pidof /opt/tivoli/tsm/db2/bin/db2fmcd`
|
|
|
08-23-2012, 09:53 AM
|
#8
|
Member
Registered: Aug 2012
Location: /home/byannoni
Distribution: Arch
Posts: 128
Rep:
|
Quote:
Originally Posted by linuxandtsm
@byannoni: you mean to copy and paste all of your code on command line ? as it is kill -9 `pidof /opt/tivoli/tsm/db2/bin/db2fmcd`
|
Yes, literally type it, `pidof /opt/tivoli/tsm/db2/bin/db2fmcd` is acctually part of the command.
|
|
|
08-23-2012, 09:59 AM
|
#9
|
Member
Registered: May 2011
Posts: 194
Original Poster
Rep: 
|
sorry still little confused...but none below worked...
Code:
# kill -9 `pidof /opt/tivoli/tsm/db2/bin/db2fmcd`
ksh: pidof: not found.
ksh: kill: 0403-008 The number of parameters specified is not correct.
# kill -9 pidof /opt/tivoli/tsm/db2/bin/db2fmcd
ksh: pidof: Specify a process identifier or a %job number.
# kill -9 pidof 8454284
ksh: pidof: Specify a process identifier or a %job number.
# kill -9 8454284
# echo $?
0
# kill -9 8454286 /opt/tivoli/tsm/db2/bin/db2fmcd
ksh: /opt/tivoli/tsm/db2/bin/db2fmcd: Specify a process identifier or a %job number.
# kill -9 `8454286 /opt/tivoli/tsm/db2/bin/db2fmcd`
ksh: 8454286: not found.
ksh: kill: 0403-008 The number of parameters specified is not correct.
The process is still there
# ps -ef|grep db
root 8454286 1 0 10:58:04 - 0:00 /opt/tivoli/tsm/db2/bin/db2fmcd
root 9830622 9961716 0 10:58:12 pts/0 0:00 grep db
#
Last edited by linuxandtsm; 08-23-2012 at 10:03 AM.
|
|
|
08-23-2012, 10:14 AM
|
#10
|
Member
Registered: May 2009
Location: Milan, Italy
Distribution: Ubuntu, Debian, Fedora, Oracle Linux
Posts: 109
Rep:
|
The pidof command just give you the process number.
That info is used by kill -9.
Monit is a tool to monitoring and restart daemon and process on a server ...
|
|
|
08-23-2012, 10:14 AM
|
#11
|
Member
Registered: Apr 2010
Location: Bayreuth, Germany
Distribution: CrunchBang Linux (#!)
Posts: 111
Rep:
|
what about
Code:
kill -9 $(pidof db2fmcd)
or
Code:
kill -9 $(pidof /opt/tivoli/tsm/db2/bin/db2fmcd)
, does one of these work?
|
|
|
08-23-2012, 10:16 AM
|
#12
|
Member
Registered: Aug 2012
Location: /home/byannoni
Distribution: Arch
Posts: 128
Rep:
|
Sorry, I didn't realize that you don't have pidof. Try these, at least one should work:
Code:
pkill -9 db2fmcd
pkill -9 /opt/tivoli/tsm/db2/bin/db2fmcd
kill -9 `pgrep db2fmcd`
kill -9 `pgrep /opt/tivoli/tsm/db2/bin/db2fmcd`
killall -9 db2fmcd
killall -9 /opt/tivoli/tsm/db2/bin/db2fmcd
Edit:
Quote:
Originally Posted by VDP76
what about
Code:
kill -9 $(pidof db2fmcd)
or
Code:
kill -9 $(pidof /opt/tivoli/tsm/db2/bin/db2fmcd)
, does one of these work?
|
Using "$()" is the same as using backticks.
Edit2:
What OS are you using? Is this a daemon/service?
Last edited by byannoni; 08-23-2012 at 10:20 AM.
|
|
|
08-23-2012, 10:22 AM
|
#13
|
Member
Registered: May 2011
Posts: 194
Original Poster
Rep: 
|
Hi all,
thanks for your replies...i got it solved by commenting out the line corresponding to db2 in /etc/inittab file and the process is gone now.
Code:
# grep db2 /etc/inittab
:fmc:2:respawn:/opt/tivoli/tsm/db2/bin/db2fmcd #DB2 Fault Monitor Coordinator
and the process is gone now
# ps -ef|grep db2
root 10158234 9961716 0 11:19:18 pts/0 0:00 grep db2
|
|
|
All times are GMT -5. The time now is 11:10 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|