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

Usecase where pkill actually doesn't kill the process #7

Open
maybites opened this issue Sep 28, 2022 · 0 comments
Open

Usecase where pkill actually doesn't kill the process #7

maybites opened this issue Sep 28, 2022 · 0 comments

Comments

@maybites
Copy link

Hi Jeremy

I have here a usecase that gives me some headakes on windows:

I am using your [shell] object to start and stop ultragrid processes (download). This works like a charm...

this example captures a spout stream and displays it inside a window.

<pre><code>
----------begin_max5_patcher----------
480.3ocqTtzaaCCC.9rCP9OHnSc.1IwN1oI4z.Fv10domVKBTr4bUmhjgdj5
hh8ee5gciwV7PWaNQKRwGejz5koShv6EsfBi1h9NJJ5EqlHuNmlndEQ3Cj1R
FQ4uH9.nTjZ.G2YTCsZug6veY67ajhZI4.5qTFnleKSKIeSRqN8URofqobiv
nRdhxWkO2bbFzB2gQIZjpQXznjJTMaq+6WSC2bvdjAZeUj1qNnS+bCDn.iQ2
2aiV4qKw9GS1LLNTdeXx501PzkOP406jPoNDozkYyVDiRWj6D44qchLqNz8d
m90zINoUD+w6cM+jxXWHVW++yZQ9.Ty1Lq3CSJGdxVKmATIkO1PcwYfo37vj
9uFbWW3vX4xTuH6BL2FiF0C.ig9rRWAR4HTkM93KFg2S30meLl8tIOakm4q2
bh7dmTjiP0Na3s9rin0R5diN7BPzI3iBf4KkqpfePLL8mvAacsuAswPzwLJ+
udJwWiNC+QyUILxx91PGrnAkYEnruQPzTAevkJBWZ7o3aNcqeKoK6hktMu+z
00bIMMGAopyiPlrqnOJjtyqiCmo7v4kgyR3Hs2kvVHlHs6LZ6v2H8EHtcUNt
yagcIlan9kLqFGqtT6+KfSrOc0PBT4+aY5D6E9cXt81I
-----------end_max5_patcher-----------
</code></pre>

(to make it work you need to download spout and start the DEMO/SpoutSender before you execute ultragrid)

.. except when I send the message 'pkill' it doesn't stop the process. It keeps on running in the background. I need to go into the taskmanager to kill it.

My way to handle this is to make first a copy of the uv.exe (to uv_1.exe) and when I want to kill it I search for the PID with the associated exe file ('tasklist /NH /FI imagename eq uv_1.exe') and kill it via (taskkill /PID xxx). This is cumbersome in many ways but kind of works. But I am very unhappy because it is not 100% reliable and the folder, in which uv.exe lies needs to have write access for the current user, which is not guaranteed either.

So I tried to compile the shell script myself to see if I can fix this - for example to get the dwProcessId directly from the shell script so can kill it via TASKKILL /PID xxx.

But I wasn't able to build because of missing libraries. And I didn't find any build instructions on your repo.

Maybe you can get me started here? Or have an idea why this process takes a live of its own in the background?

cheers

martin

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

No branches or pull requests

1 participant