Closed Alex1990 closed 8 years ago
When I type /etc/init.d/node-app start
to test in the terminal, it's ok.
When I reboot, the above problem will happen.
I got the same issue on Debian 6.
When I test it with /etc/init.d/node-app start
everything works fine.
On reboot my log file writes this:
/var/www/vhosts/localapp.7goods.de/node/app.js: line 1: syntax error near unexpected token ('/var/www/vhosts/localapp.7goods.de/node/app.js: line 1: var http = require('http');'
index.js file:
var http = require('http');
//...
Can you try setting the force flag on reboot? in the init.d script change this line to true:
FORCE_OP=false
Yes I tried it already. But it doesn't change anything.
@Alex1990 The log and pid directories don't require root permissions. It all depends on how you setup the config, how you run the script, and permissions of the locations. If you run the script as a normal user, the normal user will own the files. If you run the script as root, the files will be created and owned by root, so your normal user won't be able to modify them after that point. A possible solution, that I'm not sure is correct, is to have the script set less strict permissions on the files. I just want to make sure - the original problem you were having was only happening on restart, right? If you started fresh, used root account for everything, and restarted, do you have the same problems?
OS: Ubuntu 14.04 LTS
When I open the application in the browser, the html file is loaded. But all others can't not be loaded because the node has been stopped.
app.log file:
index.js file:
There is another problem that the
log
andpid
directories require root account. When I use a normal account to login, the app will stop because of permission.