Service-runner

Service-runner is a library that provides generalized runtime facilities for node services, including: It is used in basically all Wikimedia node.js services.
 * a standard worker cluster setup with restarts,
 * a generalized yaml config format with support for running multiple services in a single process,
 * runtime facilities for
 * logging
 * metrics reporting
 * rate limiting.

The main documentation can be found in the README document. This page is intended to augment this documentation with a FAQ, and possibly tutorial-style content.

Why are you using a server.js stub in the root of the repository, rather than using `npm start` directly?
The method of passing parameters to the script with  (as in  ) was only introduced in npm 2. Until npm in Debian is updated to >= 2.0 (it's at 1.4 still, even with node 4.6), we'll need the server.js work-around.

Even after npm is upgraded in Debian, we might still want to use a server.js script in production. Currently, most node service nodes (except for Parsoid) don't actually have npm installed, and it is not clear if we want to change this. One point of view is that (a) npm is a node package manager, and (b) you want to control what processes get started and how and npm start is considered "magic". Another potential source of issues could be firejail, but this would be quick to establish by trying it.