Reputation: 5831
I have a node.js script in my directory on my raspberry pi /home/pi/my/app/here/app.js
When I navigate using cd my/app/here
and run node app.js
my script executes without any problems. However, when I try to execute this script from a service in systemd
I get an code=exited, status=203/EXEC
error.
Here is my service file:
[Unit]
Description=App
After=network.target
[Service]
Type=simple
User=pi
ExecStart=/user/bin/node /home/pi/my/app/here/app.js
WorkingDirectory=/home/pi/my/app/here
Restart=on-failure
[Install]
WantedBy=multi-user.target
This is really my first time using systemd and most of what I have found has been through research online and other SO posts. So I am sure I am missing something pretty silly, but any help on getting my service to run would be much appreciated.
What am I missing here?
Upvotes: 0
Views: 2440
Reputation: 190976
Put a hash bang in the file
#!/usr/bin/env node
And just ensure the x
bit is set.
Upvotes: 1