Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MP3.sc: actually kill started processes #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mortuosplango
Copy link

- unixCmd doesn't return cmd PID but PID of shell containing command (see supercollider/supercollider#1738)
- kill therefore in some cases didn't kill the cmd
- use pid.neg to kill whole group as per supercollider/supercollider#1738 (comment)
@mortuosplango mortuosplango deleted the patch-1 branch February 11, 2016 11:49
@mortuosplango mortuosplango restored the patch-1 branch February 11, 2016 11:59
@mortuosplango mortuosplango deleted the patch-1 branch February 11, 2016 12:00
@mortuosplango mortuosplango restored the patch-1 branch February 11, 2016 12:01
@mortuosplango mortuosplango reopened this Feb 11, 2016
Holger Ballweg added 2 commits February 11, 2016 12:04
- kill -- -GPID doesn't seem to work reliably on a mac
- pkill does the same job in this context (kills the direct children)
@crucialfelix
Copy link
Contributor

I just tested using pkill manually. It kills the children of that process but it doesn't kill that pid.

 -P ppid     Restrict matches to processes with a parent process ID in the comma-separated list ppid.

I ran it and while it did kill the children, the parent is still running.

@mortuosplango
Copy link
Author

That's a bit annoying. It seems to somehow do it on OSX 10.10:

mooncake:build hb$ ps aux | grep lame
hb 832 0,0 0,0 2432772 628 s010 R+ 10:18am 0:00.00 grep lame
hb 811 0,0 0,0 2442744 1416 ?? S 10:16am 0:00.01 /usr/local/bin/lame --decode --silent --resample 48 /Users/hb/src/eternaldawn/recordings/254698.mp3 /tmp/sc3mp3--1660210771.fifo
hb 810 0,0 0,0 2434392 876 ?? S 10:16am 0:00.00 sh -c /usr/local/bin/lame --decode --silent --resample 48 "/Users/hb/src/eternaldawn/recordings/254698.mp3" /tmp/sc3mp3--1660210771.fifo > /dev/null
mooncake:build hb$ pkill -P 810
mooncake:build hb$ ps aux | grep lame
hb 836 0,0 0,0 2432772 644 s010 S+ 10:18am 0:00.00 grep lame

Time to find a different way I suppose

@miguel-negrao
Copy link

What about using ("kill -- -" + pid).systemCmd; ? From man kill"Negative PID values may be used to choose whole process groups;"

@mortuosplango
Copy link
Author

Yeah, that doesn't work reliably on my mac somehow. That term is not in my "man kill" so I suppose it's a linux thing.

@crucialfelix
Copy link
Contributor

I tried the negative thing too. It totally didn't work on OSX. grr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants