ndt is a Daemon Tools wrapper for NodeJS that will create, remove, and
upgrade the daemon tools folder structure. Where <action>
is from the
list below.
$ sudo su -
$ npm -g install ndt
$ cd /opt/myapp
$ ndt install
$ ndt <action>
$ ndt remove
ndt
Also supports saving instances to a local database so commands can be
ran from anywhere. Also allows use of macros. Where <action>
is from the
list below.
$ cd /opt/myapp
$ ndt save
$ cd /
$ ndt myapp <action>
$ ndt unsave myapp
These functions affect all members of the database. Where <action>
is from the
list of actions below.
$ ndt all <action>
The following actions are available when using ndt
commands that support
<action>
alarm
- Send instance an alarmcontinue
- Continue a paused instanceexit
- Have supervise exit after instance ends (not for production)hangup
- Tell an instance to hangupinterrupt
- Send instance an interruptkill
- Kill an instanceonce
- Run an instance once and dont restart if it diespause
- Pause an instancerestart
- Restart an instancestart
- Start an instancestatus
- Get instance statusstop
- Stop an instance
In order for an application to work with ndt.
{
"name": "myapp"
"cwd": "/opt/myapp",
"user": "node",
"command": "node app -vv"
"env": {
"NODE_ENV": "production",
"DEBUG": "*"
},
"log": {
"user": "node",
"command": "multilog s16777215 t /var/log/node/myapp"
}
}
It is possible to generate the dt.json file in order to make the setup process a bit less cumbersome.
In order to properly populate the environment variables. We recommend piping them through stdin.
EG:
$ su - node
$ cd /opt/myapp
$ env | ndt generate --command "node app -vv" --stdin
This package is built using the https://www.npmjs.org/package/debug package.
Use the following to see debug output
$ cd /opt/myapp
$ DEBUG=ndt* ndt install
- Fix main field
- Latest dependencies
- Update package json
- Update to latest commander
- Fix to default listing
- Fix handling of default command due to a change in commander
- Fix included daemontools template to use
setuidgid
instead ofenvuidgid
- Fix update with ndt status not listing status and producing errors
- Fix issue with list command not being called with no arguments
- Update dependencies
- Add support for latest Node.js versions
- Drop support for Node.js < 4.x
- Bump to 1.0.0 for a stable perpetual release marking 2 years with ndt in production.
- Major refactor of the internal code
- Added macro actions such as
ndt all stop
- Database is now stored globally in
/etc/ndt/ndt.json
- Confirmation of all commands working
- Completion of features and testing
- Restart now waits for process exit
- Removal now waits for process exit
- Database support
- Initial release