1837004 Members
2034 Online
110111 Solutions
New Discussion

How to user pkill

 
SOLVED
Go to solution
Binu_5
Regular Advisor

How to user pkill

Hi aLL

I have a problem in kill the shared memory
ipcs -m -p ---out put is this
shmid owner cpid lpid
40206336 naveens 8940 9687
40239105 naveens 8940 9687
40271874 naveens 8960 9687

Iam not able to kill the process started by naveen

ipcrm -m 10206338

It does not kill the procees

How to kill the process initiated by naveen

Please help

Binu
5 REPLIES 5
Gopi Sekar
Honored Contributor

Re: How to user pkill


i am not very sure whether you are giving correct shmid for ipcrm. check that first

second, you have to kill both cpid and lpid. Even if either of them still alive and locks the shared memory then you can not remove that.

Regards,
Gopi
Never Never Never Giveup
Binu_5
Regular Advisor

Re: How to user pkill

Hi Gopi

Iam killing the correct one
Please see the out put
root@wiplx03 root]# ipcrm -m 40206336
[root@wiplx03 root]# ipcs -m -p

------ Shared Memory Creator/Last-op --------
shmid owner cpid lpid
40206336 naveens 8940 9687
40239105 naveens 8940 9687
40271874 naveens 8960 9687

[root@wiplx03 root]# kill 8940 9687
-bash: kill: (8940) - No such process
-bash: kill: (9687) - No such process
[root@wiplx03 root]#

Thanks
Binu

Gopi Sekar
Honored Contributor
Solution

Re: How to user pkill


check the output of ipcs -a which actually gives detail about shared memory, semaphore and message queue.

check for the particular shared memory and the number of currently attached process to it (column title nattach), for this particular shared memory the nattach column should be 0. otherwise it means some process is still locking the shared memory thus you are not able to remove it.

Regards,
Gopi
Never Never Never Giveup
Ivan Ferreira
Honored Contributor

Re: How to user pkill

What is the output of:

ps -u naveens
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Binu_5
Regular Advisor

Re: How to user pkill

Hi
I have killed all the process initiated by the particular user and it worked fine

Thanks
Binu