https://github.com/strongloop/strong-service-install
Create/install system service for a given app
https://github.com/strongloop/strong-service-install
Last synced: 8 months ago
JSON representation
Create/install system service for a given app
- Host: GitHub
- URL: https://github.com/strongloop/strong-service-install
- Owner: strongloop
- License: other
- Created: 2014-07-18T16:34:46.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2019-02-04T21:37:44.000Z (almost 7 years ago)
- Last Synced: 2025-04-14T21:07:44.541Z (10 months ago)
- Language: JavaScript
- Size: 68.4 KB
- Stars: 7
- Watchers: 21
- Forks: 3
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# strong-service-install
Create/install system service for a given app.
Currently only supports Upstart ([strong-service-upstart](https://github.com/strongloop/strong-service-upstart))
and systemd
([strong-service-systemd](https://github.com/strongloop/strong-service-systemd)).
## Installation
`npm install strong-service-install`
## Usage
```js
var installer = require('strong-service-install');
var opts = {
name: 'my-app',
author: require('package.json').author,
user: process.env.USER,
command: 'my-app --with args --that work',
cwd: process.env.HOME,
};
installer(opts, function(err, result) {
if (err) {
console.error('Failed to install "my-app" service:', err.message);
process.exit(1);
} else {
console.log('Successfully installed "my-app" service:', result);
process.exit(0);
}
});
```
### CLI
There is a minimal CLI that exposes the API options as arguments:
```
usage: sl-svc-install [options] --
Options:
-h,--help Print this message and exit.
--name NAME Name to use for service (default derived from app)
--user USER User to run service as.
--group GROUP Group to run service as.
--jobFile PATH Upstart file to create (default /etc/init/.conf)
--cwd PATH Directory to run the service from.
--upstart [VER] Generate Upstart job for VER: 0.6 or 1.4 (default)
--systemd Generate systemd service
```