LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 08-23-2012, 09:25 AM   #1
linuxandtsm
Member
 
Registered: May 2011
Posts: 194

Rep: Reputation: Disabled
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 ?
 
Old 08-23-2012, 09:29 AM   #2
byannoni
Member
 
Registered: Aug 2012
Location: /home/byannoni
Distribution: Arch
Posts: 128

Rep: Reputation: 36
Code:
kill -9 `pidof db2fmcd`
 
Old 08-23-2012, 09:30 AM   #3
MCD555
Member
 
Registered: May 2009
Location: Milan, Italy
Distribution: Ubuntu, Debian, Fedora, Oracle Linux
Posts: 109

Rep: Reputation: 10
May Tivoli has an auto restart mechanism, it a monitor indeed :-)
Is there a tivoli root process? May if you kill that you solve ...
 
Old 08-23-2012, 09:34 AM   #4
linuxandtsm
Member
 
Registered: May 2011
Posts: 194

Original Poster
Rep: Reputation: Disabled
@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
#
 
Old 08-23-2012, 09:43 AM   #5
MCD555
Member
 
Registered: May 2009
Location: Milan, Italy
Distribution: Ubuntu, Debian, Fedora, Oracle Linux
Posts: 109

Rep: Reputation: 10
Have you monit configured on your machine?
Sorry if this question sound stupid!?
 
Old 08-23-2012, 09:45 AM   #6
byannoni
Member
 
Registered: Aug 2012
Location: /home/byannoni
Distribution: Arch
Posts: 128

Rep: Reputation: 36
Maybe this will work better:
Code:
kill -9 `pidof /opt/tivoli/tsm/db2/bin/db2fmcd`
 
Old 08-23-2012, 09:50 AM   #7
linuxandtsm
Member
 
Registered: May 2011
Posts: 194

Original Poster
Rep: Reputation: Disabled
@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`
 
Old 08-23-2012, 09:53 AM   #8
byannoni
Member
 
Registered: Aug 2012
Location: /home/byannoni
Distribution: Arch
Posts: 128

Rep: Reputation: 36
Quote:
Originally Posted by linuxandtsm View Post
@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.
 
Old 08-23-2012, 09:59 AM   #9
linuxandtsm
Member
 
Registered: May 2011
Posts: 194

Original Poster
Rep: Reputation: Disabled
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.
 
Old 08-23-2012, 10:14 AM   #10
MCD555
Member
 
Registered: May 2009
Location: Milan, Italy
Distribution: Ubuntu, Debian, Fedora, Oracle Linux
Posts: 109

Rep: Reputation: 10
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 ...
 
Old 08-23-2012, 10:14 AM   #11
VDP76
Member
 
Registered: Apr 2010
Location: Bayreuth, Germany
Distribution: CrunchBang Linux (#!)
Posts: 111

Rep: Reputation: 19
what about
Code:
kill -9 $(pidof db2fmcd)
or
Code:
kill -9 $(pidof /opt/tivoli/tsm/db2/bin/db2fmcd)
, does one of these work?
 
Old 08-23-2012, 10:16 AM   #12
byannoni
Member
 
Registered: Aug 2012
Location: /home/byannoni
Distribution: Arch
Posts: 128

Rep: Reputation: 36
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 View Post
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.
 
Old 08-23-2012, 10:22 AM   #13
linuxandtsm
Member
 
Registered: May 2011
Posts: 194

Original Poster
Rep: Reputation: Disabled
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
killng parent process without killing child process (Linux C programming) lettuce84@naver.com Linux - Newbie 3 07-24-2015 08:37 AM
Process killing... hhh123 Linux - Server 4 11-23-2011 05:50 AM
Killing More than one process ruud Programming 11 04-27-2010 06:30 AM
Killing a process by its name rabeea Linux - Networking 3 03-17-2005 05:30 AM
Really Killing a Process! lazlow69 Linux - Newbie 14 05-10-2003 10:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration