Linux SystemD help please

I am doing something really dumb but can't figure it out.
I need to run numerous instances of Node-Red. As such, I have under my /home/myusername 2 folders "nr1" and "nr2".
I have run npm i node-red in each of those sub folders and it installs node-red.
In each of those, I have modified the settings.js file to set the ports to 1880 and 1881 as well as the home directory to be /home/myusername/nr1 and nr2.

So, if I manually issue /usr/bin/node /home/myusername/nr1/node_modules/node-red/red.js Node-Red fires right up.
Now here is the problem. I want to start these via systemd. So, I have created a "nr1.service" file with the following information:

[Unit]
Description=Node-Red for NR1
Documentation=Documentation : Node-RED
After=syslog.target network.target

[Service]
Type=simple
ExecStart=/usr/bin/node /home/administrator/nr1/node_modules/node-red/red.js
WorkingDirectory=/home/administrator/nr1
Nice=10
Restart=on-failure
KillSignal=SIGINT
ProtectSystem=full

[Install]
WantedBy=multi-user.target

When I try to start the service, it says permission denied on /home/nr1. I checked my settings file and I did have that in there (was a typo). I have since changed it to be /home/myusername/nr1/ but that does not solve things.

Any ideas as to what I am doing wrong?

Hi, been a long day today for me so I can't quite focus on what might be wrong. However, if you check out my alternate installer on GitHub, it contains an annotated example service file that might help.

You also need

User=administrator
Group=administrator

or whatever user/group you want to run the service as.

Everyone was close.
Coming from a windows world to linux, remember to check your typing.

I had a small typo in my settings.js file that was goofing things up.

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