I have a simple nodeJs upstart service run as,
script
exec /usr/bin/node /path/to/server.js
end script
On running with sudo command, it works
~$ sudo service upserv start
sg_gui_server start/running, process 19321
When it is ran as a root user, it fails with bizarre error.
~$ sudo su
sk# service sg_gui_server restart
karaf: JAVA_HOME not set; results may vary
JAVA_HOME not set, this error is bizarre as nodeJs is not dependent on java libs and this error comes, when i run a simple python server as well.
How does running a service with sudo prefix differ from running it as a root user?