# How to enter a line after an exec node is started

**URL:** <https://discourse.nodered.org/t/how-to-enter-a-line-after-an-exec-node-is-started/12442>\
**Category:** General\
**Created:** [20 June 2019 20:27 UTC](https://discourse.nodered.org/t/how-to-enter-a-line-after-an-exec-node-is-started/12442 "2019-06-20T20:27:58Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)\
**Post date:** [3 July 2019 20:03 UTC](https://discourse.nodered.org/t/how-to-enter-a-line-after-an-exec-node-is-started/12442/21 "2019-07-03T20:03:06Z")

</div>

Thank you for the update, I’m going to see if I can reproduce it with this script.

---

<div class="post-metadata">

**Author:** ![martinboers](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@martinboers](https://discourse.nodered.org/u/martinboers)\
**Post date:** [11 July 2019 07:02 UTC](https://discourse.nodered.org/t/how-to-enter-a-line-after-an-exec-node-is-started/12442/22 "2019-07-11T07:02:34Z")

</div>

The reason that the creds.data file cannot be found by the node-red instance that is started by your init.d script, is that the init.d script starts node-red using `start-stop-daemon`.

From the man page for start-stop-daemon:

```auto
-d, --chdir path
              Chdir to path before starting the process. This is done after
              the chroot if the -r|--chroot option is set. When not
              specified, start-stop-daemon will chdir to the root directory
              before starting the process.

```

So in this case you have two options:

1. Put the creds.data file in the root directory "/".

2. Add the -d option to the start-stop-daemon command, with the path to the creds.data file.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![mike67](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@mike67](https://discourse.nodered.org/u/mike67)\
**Post date:** [11 July 2019 09:58 UTC](https://discourse.nodered.org/t/how-to-enter-a-line-after-an-exec-node-is-started/12442/23 "2019-07-11T09:58:58Z")

</div>

Thanks a lot Martin.  
your answer helps mee.  
I choose the option to add my actual directory in the option oif the deammon, and it works 🙂

```auto
start_daemon () {
        start-stop-daemon --chdir /opt/plcnext --start --

```

[Previous page](https://discourse.nodered.org/t/how-to-enter-a-line-after-an-exec-node-is-started/12442.md?page=1)
