zapty / forever-service

Provision node script as a service via forever, allowing it to automatically start on boot, working across various Linux distros and OS
https://github.com/zapty/forever-service
MIT License
595 stars 65 forks source link

forever-service can't find node on centos 7 #87

Open msawired opened 7 years ago

msawired commented 7 years ago

Hi I am getting an error, which seems to say it is trying to run node as "/usr/bin/env: node", not "/usr/bin/env node".

forever-service version 0.5.9

Platform - CentOS Linux release 7.2.1511 (Core)

socketServer provisioned successfully

Commands to interact with service socketServer Start - "sudo service socketServer start" Stop - "sudo service socketServer stop" Status - "sudo service socketServer status" Restart - "sudo service socketServer restart" /usr/bin/env: node: No such file or directory Starting socketServer /usr/bin/env: node: No such file or directory Service could not be started

jaymehtasa commented 7 years ago

Any update on this would help, facing same issues Amazon AMI.

arvind-agarwal commented 7 years ago

Can you try solution found in https://github.com/zapty/forever-service/issues/50

jaymehtasa commented 7 years ago

Worked well with solution provided in #50

joneldiablo commented 3 years ago

I have an error something like that: I try

sudo env "PATH=$PATH" forever-service install validex-cron -f " --watchDirectory ./src -w -o out.log -e err.log -c /home/ubuntu/.nvm/versions/node/v14.16.1/bin/node" --script ./src/index.js -e "PATH=/usr/local/bin:$PATH"

but not working, the service install ok, but not run the script, checking the service status:

● validex-cron.service - LSB: forever-service startup script for validex-cron
   Loaded: loaded (/etc/init.d/validex-cron; generated)
   Active: failed (Result: exit-code) since Fri 2021-04-16 16:05:29 UTC; 14min ago
     Docs: man:systemd-sysv-generator(8)

Apr 16 16:05:29 ip-172-31-34-236 systemd[1]: Starting LSB: forever-service startup script for validex-cron...
Apr 16 16:05:29 ip-172-31-34-236 validex-cron[18066]: /usr/bin/env: ‘node’: No such file or directory
Apr 16 16:05:29 ip-172-31-34-236 validex-cron[18066]: Starting validex-cron
Apr 16 16:05:29 ip-172-31-34-236 validex-cron[18066]: /usr/bin/env: ‘node’: No such file or directory
Apr 16 16:05:29 ip-172-31-34-236 systemd[1]: validex-cron.service: Control process exited, code=exited status=127
Apr 16 16:05:29 ip-172-31-34-236 systemd[1]: validex-cron.service: Failed with result 'exit-code'.
Apr 16 16:05:29 ip-172-31-34-236 systemd[1]: Failed to start LSB: forever-service startup script for validex-cron.