Hi All,
I think this is probably an easy solve.
node-red is running as user node-js-node-red:
[st@luthis /]$ ps -ef | grep node
nodejs-+ 417957 1 0 09:47 ? 00:00:02 node-red
I wrote a file out using write file node:
ll /var/lib/nodejs-node-red/nodelogtesttest
-rw-r--r-- 1 nodejs-node-red nodejs-node-red 6 Jan 27 10:03 nodelogtesttest
That's what it has in the service file:
[st@luthis /]$ cat /usr/lib/systemd/system/nodejs-node-red.service
[Unit]
Description=Node-RED graphical event wiring tool
Wants=network.target
Documentation=https://nodered.org/docs/
[Service]
Type=simple
User=nodejs-node-red
Group=nodejs-node-red
WorkingDirectory=/var/lib/nodejs-node-red
EnvironmentFile=/etc/default/nodejs-node-red
ExecStart=/usr/bin/node-red ${NODE_OPTIONS} ${NODE_RED_OPTIONS}
KillSignal=SIGINT
Restart=on-failure
[Install]
WantedBy=multi-user.target
My passwd file:
[st@luthis /]$ cat /etc/passwd
st:x:1000:1000::/home/st:/bin/bash
nodejs-node-red:x:962:962::/var/lib/nodejs-node-red:/usr/bin/nologin
I added nodejs user to my group:
[st@luthis /]$ cat /etc/group
st:x:1000:nodejs-node-red
nodejs-node-red:x:962:
But none of that has helped this issue which I'm trying to solve. When running an exec I get:
Command failed: python /home/st/Projects/Planner/monitors.py false
python: can't open file '/home/st/Projects/Planner/monitors.py': [Errno 13] Permission denied
Running the python script as myself it works fine.
I am not able to write out a file to home dir with node-red so I understand that node-red doesn't have the right permissions to be able to run the python file or even access anything in my home dir.
I just don't know what else I need to do to get it working.
Also tried changing the user and group in the node-red service file to my user/group (and restarted daemon etc) but that didn't work either.
Any tips?
EDIT:
also the history is I imported this flow from my previous install. computer name changed but user/group didn't. I forgot to export them so I just imported from the json file in my old drive.