N
N
nepster-web2014-02-05 02:04:59
Node.js
nepster-web, 2014-02-05 02:04:59

How to run node.js in the background with sudo?

There is a user, in his home directory there is a folder with node.js scripts
The user has the sudo command
So if you run such a command

nohup node /home/user/sc/node/index.js > /dev/null 2>&1 &

The node starts in the background, but it works with files, and in this situation, for some reason, it does not create files.
If you run it as root, then everything is fine (but I turned off the root)
If you run the same command through sudo , then we catch Exit 127 and the node goes dead.
Please tell me what is the problem?
How it is possible from under each user to start the scripts?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question