pueue icon indicating copy to clipboard operation
pueue copied to clipboard

Possible Pebcak - How can i extract the PID of a current running task.

Open getsec opened this issue 3 years ago • 1 comments

Is is possible to get the process ID of a given task?

I've checked the json output and havent seen anything there?

cheers

getsec avatar Sep 20 '22 18:09 getsec

This isn't possible yet, since this can also be quite confusing.

As we're using a shell as an executor, there can be multiple pids at once, pids can change rapidly and under Mac this doesn't work at all since no one wrote a library to get child process IDs yet :D

I'm not sure if this is something we should expose via the Json output, as it feels like this info should only be used by the scheduler that's actually responsible for handling these processes.

What's your use case if I may ask :)?

Nukesor avatar Sep 21 '22 08:09 Nukesor

Ping @getsec

Nukesor avatar Sep 30 '22 20:09 Nukesor

@Nukesor - Apologies for the late reply. I was looking to use this in a platform I run to manage long running proceses. Previously, we used some basic python async subprocess modules to launch long running proceses and stored / managed process ID's in a database. Since then, I've actually switched from using process Ids to using the pueue task IDs, I don't think this is needed to be open anymore

getsec avatar Oct 01 '22 19:10 getsec

Perfect :) Thanks for the clarification!

Nukesor avatar Oct 01 '22 20:10 Nukesor