# Tracking exec node spawn PIDs

**URL:** <https://discourse.nodered.org/t/tracking-exec-node-spawn-pids/74284>\
**Category:** Feature Requests\
**Created:** [28 January 2023 08:17 UTC](https://discourse.nodered.org/t/tracking-exec-node-spawn-pids/74284 "2023-01-28T08:17:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [28 January 2023 08:17 UTC](https://discourse.nodered.org/t/tracking-exec-node-spawn-pids/74284/1 "2023-01-28T08:17:56Z")

</div>

The exec node PID is propagated via the status node in the `status.text` property, however, there is no context, other than the originating exec node.

When executing different types of commands (and i mean a lot of them), there is no way to keep track which PID is responsible for which process. Would it be possible to add the PID to the std out/return code output as well, as a property (something like `msg._pid)` ?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [28 January 2023 08:48 UTC](https://discourse.nodered.org/t/tracking-exec-node-spawn-pids/74284/2 "2023-01-28T08:48:20Z")

</div>

Well it could, but nothing comes out of those outputs until after the command has finished, whereas you may need the pid when it starts if you need to monitor/kill it

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [28 January 2023 09:00 UTC](https://discourse.nodered.org/t/tracking-exec-node-spawn-pids/74284/3 "2023-01-28T09:00:52Z")

</div>

Indeed by default I think i don't need the pid (although it still wouldn't hurt, in case it hangs somewhere), but I was referring to the spawn mode.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [28 January 2023 09:15 UTC](https://discourse.nodered.org/t/tracking-exec-node-spawn-pids/74284/4 "2023-01-28T09:15:14Z")

</div>

In spawn mode it still wouldn’t appear until the command sends something. Would that be ok ?

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [28 January 2023 09:36 UTC](https://discourse.nodered.org/t/tracking-exec-node-spawn-pids/74284/5 "2023-01-28T09:36:19Z")

</div>

I think so yes, that would be great. I will use a different property for the actual command, so that the complete command + pid would be/remain available in the msg that can be used as reference.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [28 January 2023 09:44 UTC](https://discourse.nodered.org/t/tracking-exec-node-spawn-pids/74284/6 "2023-01-28T09:44:39Z")

</div>

of course you should be able to add your own msg.property and it should be preserved if you need to track requests.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [29 March 2023 09:45 UTC](https://discourse.nodered.org/t/tracking-exec-node-spawn-pids/74284/7 "2023-03-29T09:45:09Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
