strong-service-install
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -29,8 +29,9 @@ #!/usr/bin/env node | ||
p(' -h,--help Print this message and exit.'); | ||
p(' --name Name to use for service (default derived from app)') | ||
p(' --user User to run service as.'); | ||
p(' --group Group to run service as.'); | ||
p(' --jobFile Upstart file to create (default /etc/init/<name>.conf)'); | ||
p(' --cwd Directory to run the service from.'); | ||
p(' --upstart Version of Upstart to assume: 0.6 or 1.4 (default)'); | ||
p(' --name NAME Name to use for service (default derived from app)') | ||
p(' --user USER User to run service as.'); | ||
p(' --group GROUP Group to run service as.'); | ||
p(' --jobFile PATH Upstart file to create (default /etc/init/<name>.conf)'); | ||
p(' --cwd PATH Directory to run the service from.'); | ||
p(' --upstart [VER] Generate Upstart job for VER: 0.6 or 1.4 (default)'); | ||
p(' --systemd Generate systemd service'); | ||
} |
@@ -0,1 +1,7 @@ | ||
2014-11-13, Version 1.1.0 | ||
========================= | ||
* Add support for installing systemd services (Ryan Graham) | ||
2014-11-03, Version 1.0.1 | ||
@@ -25,7 +31,2 @@ ========================= | ||
2014-07-21, Version 0.1.2 | ||
========================= | ||
2014-07-21, Version 0.1.1 | ||
@@ -42,2 +43,7 @@ ========================= | ||
2014-07-21, Version 0.1.2 | ||
========================= | ||
* First release! |
16
index.js
@@ -7,2 +7,3 @@ var assert = require('assert'); | ||
var upstartMaker = require('strong-service-upstart'); | ||
var systemdMaker = require('strong-service-systemd'); | ||
var uidNumber = require('uid-number'); | ||
@@ -71,2 +72,7 @@ var mkdirp = require('mkdirp'); | ||
// TODO: select sub-installer here when there's more than just Upstart | ||
if (opts.systemd) { | ||
opts.generator = systemdMaker; | ||
} else { | ||
opts.generator = upstartMaker; | ||
} | ||
if (opts.upstart) { | ||
@@ -138,3 +144,9 @@ opts.version = opts.upstart; | ||
if (!opts.jobFile) { | ||
opts.jobFile = '/etc/init/' + opts.name + '.conf'; | ||
if (opts.generator === systemdMaker) { | ||
opts.jobFile = '/etc/systemd/system/' + opts.name + '.service'; | ||
} else if (opts.generator === upstartMaker) { | ||
opts.jobFile = '/etc/init/' + opts.name + '.conf'; | ||
} else { | ||
return next(new Error('Unknown init type, no path given')); | ||
} | ||
} | ||
@@ -166,3 +178,3 @@ | ||
function generateJob(opts, next) { | ||
upstartMaker(opts, function(err, job) { | ||
opts.generator(opts, function(err, job) { | ||
if (!err) | ||
@@ -169,0 +181,0 @@ opts.generatedJob = job; |
{ | ||
"name": "strong-service-install", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Install a module as an OS service", | ||
@@ -35,2 +35,3 @@ "main": "index.js", | ||
"shell-quote": "^1.4.2", | ||
"strong-service-systemd": "^1.0.0", | ||
"strong-service-upstart": "^1.0.0", | ||
@@ -37,0 +38,0 @@ "uid-number": "0.0.5", |
@@ -44,8 +44,9 @@ # strong-service-install | ||
-h,--help Print this message and exit. | ||
--name Name to use for service (default derived from app) | ||
--user User to run service as. | ||
--group Group to run service as. | ||
--jobFile Upstart file to create (default /etc/init/<name>.conf) | ||
--cwd Directory to run the service from. | ||
--upstart Version of Upstart to assume: 0.6 or 1.4 (default) | ||
--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/<name>.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 | ||
``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
25673
15
249
52
1
9
+ Addedstrong-service-systemd@1.2.3(transitive)