Hello Could you post an init-script for use on our server?
Michael 263 Posted November 28, 2016 Share this comment what OS do you have and do you have forever installed? Link to comment Share on other sites More sharing options...
Kjell Iver Johansen 6 Posted November 28, 2016 Share this comment Yes - forever is installed. Linux 4.4.0-47-generic #68-Ubuntu SMP Wed Oct 26 19:39:52 UTC 2016 x86_64 It is my co-admin doing the technical stuff on the server. Hope this is was you're looking for,. Link to comment Share on other sites More sharing options...
Michael 263 Posted November 28, 2016 Share this comment yeah, different versions of the same distro can use different init systems. most of them use systemd now days. there are still a few hold outs on using sysV and some might still being usings ubuntu's upstart. I'll get a guide written up for how to add one for systemd and your tech guy can get it configured and running :). 1 Link to comment Share on other sites More sharing options...
Michael 263 Posted December 2, 2016 Share this comment i'm not ignoring you, i swear, i just forgot about this its on the agenda today, hope i can get to it 1 Link to comment Share on other sites More sharing options...
Kjell Iver Johansen 6 Posted December 2, 2016 Share this comment My technic-admin is abroad I think, so I can't complete my babble installation anyway. Appreciate your work here and there. I'll buy you a beer when finished (norwegian beer are expensive) Link to comment Share on other sites More sharing options...
Kjell Iver Johansen 6 Posted December 11, 2016 Share this comment Did you have time to look at this init-file? Link to comment Share on other sites More sharing options...
Michael 263 Posted December 12, 2016 Share this comment sudo nano /etc/systemd/system/babble.service create the file, it will open, put this as the content: [Unit] Description=Babble Server [Service] ExecStart=/usr/bin/node /path/to/babble/node/folder/babble.js Restart=always RestartSec=5 # Restart service after 5 seconds if node service crashes StandardOutput=syslog # Output to syslog StandardError=syslog # Output to syslog SyslogIdentifier=babble.js-server #User=<alternate user> #Group=<alternate group> Environment=NODE_ENV=production PORT=3000 [Install] WantedBy=multi-user.target note: if you didn't symlink nodejs to node in /usr/bin, ExecStart would be: ExecStart=/usr/bin/nodejs /path/to/babble/node/folder/babble.js ctrl+o (saves it), ctrl+x will exit it. (this is if you use nano, use whatever cli editor you want). next enable: sudo systemctl enable babble.service start: systemctl start babble.service verify it: systemctl status babble.service this is for systemd (which i believe was adopted for ubuntu server 14.10, but it is def in 16.04 lts). Link to comment Share on other sites More sharing options...
Recommended Comments