Skip to content

oOthkOo/node-start-stop-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ubuntu NodeJS daemon script

SlugBay Badge

A Ubuntu script to daemonize NodeJS server in a easy way. Features

  • Ubuntu compatible
  • Stop NodeJS properly
  • LOG file support
  • PID file support
  • User uid:gid support

Configuration

Change this parameter value in node-server script : (ex: user:user)

DAEMON_USER="{your-user-uid:your-user-gid}"

Change theses parameters value in node-exec script : (ex: /var/lib/node)

DAEMON_APP_DIR="{your-app-directory}"

Install

$ sudo cp node-server node-exec /etc/init.d/
$ sudo cd /etc/init.d/
$ sudo chmod +x node-server node-exec
$ sudo update-rc.d node-server defaults

Usage

/etc/init.d/node-server {start|stop|status|restart|force-reload}

$ sudo /etc/init.d/node-server start
$ sudo /etc/init.d/node-server stop
$ sudo /etc/init.d/node-server restart

Uninstal

$ sudo cd /etc/init.d/
$ sudo update-rc.d -f node-server remove
$ sudo rm -f /etc/init.d/node-exec

About

A Ubuntu start-stop-daemon script to restart NodeJS server in a easy way

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages