So we have a bunch of old (like 2 years) Ubuntu 14.04 servers running production application, which has an API endpoint in Node.

But we have no idea how to start/stop/restart node on it.. it just comes up when we reboot the machine :)

I have tried popular answers like pm2, forever, systemd, and StrongLoop - none seem to be used to start node. I also looked at /etc/init and init.d, and cant find anything that looks like it.

Any suggestions how to find it?

The Original author of the application is long gone...

The only other clue I have is /etc/apache2/conf-available/javascript-common.conf Which contains

Alias /javascript /usr/share/javascript/

<Directory "/usr/share/javascript/">
    Options FollowSymLinks MultiViews

When I go to that directoy, I found 2 files: /usr/share/javascript/node-uuid/uuid.js and I suppose same .min.js file, seems to be library to generate UUIDs, and I dont see any references to our application...

Also I know the app.js has app.listen(8080), so I doubt this is done by apache/nginx, but I don't know enough about node+web server setups to know...

 ls -alR /etc/apache2/
total 12
drwxr-xr-x   3 root root 4096 Apr  4  2017 .
drwxr-xr-x 104 root root 4096 Sep 14 11:41 ..
drwxr-xr-x   2 root root 4096 Sep 14 11:48 conf-available

total 12
drwxr-xr-x 2 root root 4096 Sep 14 11:48 .
drwxr-xr-x 3 root root 4096 Apr  4  2017 ..
-rw-r--r-- 1 root root  127 Aug 11  2013 javascript-common.conf
  • 1
    Maybe /etc/rc.local ? – Mr Shunz Sep 14 '18 at 15:39
  • chkconfig: command not found so not that... – Carmageddon Sep 14 '18 at 15:39
  • @MrShunz not there, it only runs some corporate script, and then starts chef-client – Carmageddon Sep 14 '18 at 15:41
  • 2
    I'm sorry, im an idiot. Node applications are built and compiled by node. But only really hosted by node in a testing environment. Prod env tend to use apache or nginx to serve the files. I would look at apache or nginx config files for the dir paths of the compiled JS code that is your website. ( you might get lucky, if you grep -iR "websitename" /etc/httpd/conf* ubuntu 14 may be using the dir name "apache2" instead of httpd. My ubuntu 14 knowledge is now a little rusty, i would need to boot up a node and look at it now. – Arlion Sep 14 '18 at 15:42
  • @Arlion I just edited the question with information on what I found under apache2 (there is no httpd there) - not sure about nginx, but there is no directory called that way in /etc – Carmageddon Sep 14 '18 at 15:51

For a time, before Ubuntu finally gave up on upstart and switched to systemd, it was popular to use supervisor to start Node (and some who follow obsolete Internet tutorials still attempt to use it). Run supervisorctl and it will show the status of any applications it manages.

  • supervisorctl is not installed, so not that :( – Carmageddon Sep 14 '18 at 18:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.