The .pkg
file is for OSX. There are some repositories that have binaries for Debian, but it is probably easiest to download and compile the code. NodeJS is updated very frequently - so most repositories have very outdated versions. You will need some development tools (compiler, etc.) to be able to build the source.
sudo apt-get update
sudo apt-get install curl build-essential openssl libssl-dev
You can either download the source from the Node.JS site or pull it from github. The advantage of the latter is ease of maintenance.
NodeJS:
If you wish, you can install node to a directory other than the default, by adding --prefix /path/to/install/directory to your configure line, below. (Only use one of the following, not both)
From GitHub:
sudo apt-get install git-core
cd /usr/local/src ##or whatever directory you like#
git clone https://github.com/joyent/node.git && cd node
./configure
make
sudo make install
From source - tarball:
cd /usr/local/src ##or whatever directory you like#
wget http://nodejs.org/dist/v0.6.6/node-v0.6.6.tar.gz
tar -xzvf node-v0.6.6.tar.gz
cd node-v0.6.6
./configure
make
sudo make install
NPM:
NPM is already included with recent versions of node. Verify that it is installed with npm -v. If a version is displayed, there is no need to do the step below. If the 'easy install' doesn't work for you, you can also download the code and make install.
curl http://npmjs.org/install.sh | sudo sh
Should the app itself really know how to daemonize itself...
If your app is meant to be run as a daemon, yes, it should be fully aware of how to daemonize itself, write the appropriate files (log and PID spring to mind), and handle signal. Big WTF if this isn't the case.
If your app isn't really meant to be daemonized, or that's not it's primiary purpose, then it's your decision completely. If you want to make it easy for others, you'll probably add it. If you want to make life easier on yourself, you'll probably leave it out. People generally wont have a "WTF" response either way.
Service starters...
Each distro's packages/ports system should be responsible for modifying your generic start/stop scripts to meet their particular needs. This stuff generally ain't rocket science, but when in doubt contact the maintainers for the distro you're working on.
Monitoring tools..
Should know how to interact with the Distro's official start/stop mechanisms, and should have no idea how to interact with your program specifically (unless your program "publishes" data through a reporting mechanism, possibly including hooks for a SNMP service or similar; all this really depends on what your program does though).
Best Answer
Try using
ctrl+c
, usually does the trick.