This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Process in not get killed using subprocess.call() in python thread
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.3, Python 2.7
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: matrixise, sanky8793
Priority: low Keywords:

Created on 2017-07-13 15:46 by sanky8793, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (4)
msg298293 - (view) Author: Sanket (sanky8793) Date: 2017-07-13 15:46
import threading
import subprocess

def B():
    while True:
        break
    cmd="ps -ef | grep 'shell' | awk '{print $2}' | xargs kill -9"
    subprocess.call(cmd, shell=True)


def A():
    th = threading.Thread(target=B)
    th.start()




In above code,  process with name "shell" has to be killed,  but its not working. While same when I do in simple without thread,  its working


Why you are not answering here,at last I just had to deal with answer whether its getting here or else where
msg298296 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2017-07-13 16:03
So top ope in tickets about this issue or you will be banned.

On Jul 13, 2017 8:46 AM, "Sanket" <report@bugs.python.org> wrote:

>
> New submission from Sanket:
>
> import threading
> import subprocess
>
> def B():
>     while True:
>         break
>     cmd="ps -ef | grep 'shell' | awk '{print $2}' | xargs kill -9"
>     subprocess.call(cmd, shell=True)
>
>
> def A():
>     th = threading.Thread(target=B)
>     th.start()
>
>
>
>
> In above code,  process with name "shell" has to be killed,  but its not
> working. While same when I do in simple without thread,  its working
>
>
> Why you are not answering here,at last I just had to deal with answer
> whether its getting here or else where
>
> ----------
> components: Library (Lib)
> messages: 298293
> nosy: gvanrossum, sanky8793
> priority: normal
> severity: normal
> status: open
> title: Process in not get killed using subprocess.call() in python thread
> type: behavior
> versions: Python 2.7, Python 3.3
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue30922>
> _______________________________________
>
msg298297 - (view) Author: Sanket (sanky8793) Date: 2017-07-13 16:05
Can i get solution here
msg298298 - (view) Author: Stéphane Wirtel (matrixise) * (Python committer) Date: 2017-07-13 16:18
@sanky8793 please, use the python-list for that https://mail.python.org/mailman/listinfo/python-list

Thank you
History
Date User Action Args
2022-04-11 14:58:49adminsetgithub: 75105
2017-07-13 16:18:13matrixisesetstatus: open -> closed
priority: normal -> low
nosy: + matrixise, - gvanrossum
messages: + msg298298

stage: resolved
2017-07-13 16:05:03sanky8793setmessages: + msg298297
2017-07-13 16:03:13gvanrossumsetmessages: + msg298296
2017-07-13 15:46:08sanky8793create