1.0.2 • Published 1 year ago
systemctl-node v1.0.2
systemctl-node
A simple control module from C bindings for service control with Systemd - systemctl lib (created for Ubuntu/Debian systems)
Installation
Install systemctl-node with npm
npm install systemctl-nodeInstall systemctl-node with yarn
yarn add systemctl-nodeUsage/Examples
Requires privilege escalation - (run with sudo)
// app.js
const systemctl = require("systemctl-node");
/* Start service */
systemctl.start("nginx")
/* Stop service */
systemctl.stop("nginx")
/* Restart service */
systemctl.restart("nginx")Run app
$ sudo node app.js