# Exec node - help with how it spawns

**URL:** <https://discourse.nodered.org/t/exec-node-help-with-how-it-spawns/95957>\
**Category:** General\
**Created:** [12 March 2025 23:12 UTC](https://discourse.nodered.org/t/exec-node-help-with-how-it-spawns/95957 "2025-03-12T23:12:30Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [13 March 2025 09:45 UTC](https://discourse.nodered.org/t/exec-node-help-with-how-it-spawns/95957/3 "2025-03-13T09:45:01Z")

</div>

I have not read your full post but did see you were having issues with issuing amixer commands from an exec node.

I faced a similar issue and after much digging found that adding the below Env Var to the environment before launching Node-RED solved it.

```bash
XDG_RUNTIME_DIR=/run/user/$(id -u) node-red

```

If you run Node-RED as a service, then you will need to identify the user (often this is `pi`) and explicitly set the value e.g.

```bash
# get the uid of user pi
id -u pi
# outputs 1000

```

modify the service

```bash
sudo systemctl edit node-red.service

```

Then add:

```bash
[Service]
Environment=XDG_RUNTIME_DIR=/run/user/1000

```

---

_[View the full topic](https://discourse.nodered.org/t/exec-node-help-with-how-it-spawns/95957)._
