Started Node-RED graphical event wiring tool.
nodered.service: Failed to determine user credentials: No such process
nodered.service: Failed at step USER spawning /usr/bin/env: No such process
nodered.service: Main process exited, code=exited, status=217/USER
nodered.service: Failed with result 'exit-code'.
nodered.service: Scheduled restart job, restart counter is at 2.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
nodered.service: Main process exited, code=exited, status=217/USER
nodered.service: Failed with result 'exit-code'.
nodered.service: Scheduled restart job, restart counter is at 3.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
nodered.service: Main process exited, code=exited, status=217/USER
nodered.service: Failed with result 'exit-code'.
nodered.service: Scheduled restart job, restart counter is at 4.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
nodered.service: Main process exited, code=exited, status=217/USER
nodered.service: Failed with result 'exit-code'.
nodered.service: Scheduled restart job, restart counter is at 5.
Stopped Node-RED graphical event wiring tool.
nodered.service: Start request repeated too quickly.
nodered.service: Failed with result 'exit-code'.
Failed to start Node-RED graphical event wiring tool.
I tried different things from Google search but I don't get it running.
Does anybody know what's wrong?
Have you removed, or renamed, the user that was logged on when you ran the script? If so then run systemctl status nodered
Which will tell you where nodered.service is and change all references to the old user to a valid user. Then reboot. In fact you don't need to reboot, you can run a command that will reload the service file, but I am on my phone and can't remember what it is.
Starting as root systemd service.
Started Node-RED graphical event wiring tool.
nodered.service: Main process exited, code=exited, status=217/USER
nodered.service: Failed with result 'exit-code'.
nodered.service: Scheduled restart job, restart counter is at 1.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
nodered.service: Main process exited, code=exited, status=217/USER
nodered.service: Failed with result 'exit-code'.
nodered.service: Scheduled restart job, restart counter is at 2.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
nodered.service: Main process exited, code=exited, status=217/USER
nodered.service: Failed with result 'exit-code'.
nodered.service: Scheduled restart job, restart counter is at 3.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
nodered.service: Main process exited, code=exited, status=217/USER
nodered.service: Failed with result 'exit-code'.
nodered.service: Scheduled restart job, restart counter is at 4.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
nodered.service: Main process exited, code=exited, status=217/USER
nodered.service: Failed with result 'exit-code'.
nodered.service: Scheduled restart job, restart counter is at 5.
Stopped Node-RED graphical event wiring tool.
nodered.service: Start request repeated too quickly.
nodered.service: Failed with result 'exit-code'.
Failed to start Node-RED graphical event wiring tool.
Sorry, I don't know what's wrong. Is user 'docker' unable to access 'lib/systemd/system/nodered.service' ???
OK - now I found the mistake, I didn't change the username in the file to the correct user. I changed the user in the file (in the [service] part) an now it's working!!!
Thanks
# systemd service file to start Node-RED
[Unit]
Description=Node-RED graphical event wiring tool
Wants=network.target
Documentation=http://nodered.org/docs/hardware/raspberrypi.html
[Service]
Type=simple
# Run as normal pi user - change to the user name you wish to run Node-RED as
User=username
Group=groupname
WorkingDirectory=/home/username
Nice=5
Environment="NODE_OPTIONS=--max_old_space_size=256"
# uncomment and edit next line if you need an http proxy
#Environment="HTTP_PROXY=my.httpproxy.server.address"
# uncomment the next line for a more verbose log output
#Environment="NODE_RED_OPTIONS=-v"
#ExecStart=/usr/bin/env node $NODE_OPTIONS red.js $NODE_RED_OPTIONS
ExecStart=/usr/bin/env node-red-pi $NODE_OPTIONS $NODE_RED_OPTIONS
# Use SIGINT to stop
KillSignal=SIGINT
# Auto restart on crash
Restart=on-failure
# Tag things in the log
SyslogIdentifier=Node-RED
#StandardOutput=syslog
[Install]
WantedBy=multi-user.target
That should have been setup by the install script. I imagine the install log is long gone so it is difficult to know why that might have happened. Unless you fetched that file again for some reason.