@mh-cbon/which-service-manager
Tells which service manager the system is running
Last updated 4 years ago by mh-cbon .
MIT · Original npm · Tarball · package.json
$ cnpm install @mh-cbon/which-service-manager 
SYNC missed versions from official npm registry.

which-service-manager

Tells the service manager running on the current system.

Install

npm i @mh-cbon/which-service-manager --save

Usage

// print list of identifiable service manager
console.log(require('@mh-cbon/which-service-manager').sysInits);
  // serviceManager is one of
  // - systemd
  // - upstart
  // - chkconfig
  // - launchd
  // - sc
  // - sysv

// get current system manager
require('@mh-cbon/which-service-manager')(function (err, serviceManager, bin) {
  err && console.error(err);
  !err && console.log("System found is %s", serviceManager);
  !err && bin && console.log("It provides a binary path %s", bin);
})

// get all system manager running on the system
require('@mh-cbon/which-service-manager').all(function (err, sysInits) {
  err && console.error(err);
  !err && console.log("Init systems found are %j", sysInits);
  Object.keys(sysInits).forEach(function (system) {
    !err && bin && console.log("It provides %s a binary path %s", system.sys, system.path);
  })
})


Todos

  • add openrc support (gentoo)

Read more

Current Tags

  • 1.0.4                                ...           latest (4 years ago)

4 Versions

  • 1.0.4                                ...           4 years ago
  • 1.0.3                                ...           4 years ago
  • 1.0.2                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |