
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
node-systemctl
Advanced tools
Control your systemd services from the comfort of your NodeJS script, using this hacky interface module.
npm i node-systemctl
or
yarn add node-systemctl
Note: examples assume ES6 modules enabled.
import SystemService from 'node-systemctl'
// construct the service
// using await
const unit = await new SystemService('custom-unit')
if (!unit.isActive) await unit.start()
// or using .then()
new SystemService('custom-unit').then(async unit => {
if (!unit.isActive) await unit.start()
})
If your service requires root privilages (or you are getting the Interactive authentication required error) pass a truthy value as the second argument:
const superUnit = await new SystemService('custom-unit', true)
Note: Following methods are async, use await if you need to wait for them to finish.
start() - Actually restart() in disguise, see below.restart() - Starts/restarts the service. Equivalent of systemctl restart <service>.stop() - Stops the service. Equivalent of systemctl stop <service>.enable() - Enables start at boot. Equivalent of systemctl enable <service>.disable() - Disables start at boot. Equivalent of systemctl disable <service>.edit() - Opens the unit file in an editor. Equivalent of systemctl edit --full <service>. (Only for use in a CLI environment)isActive: boolean - Returns true if the service is running, i.e., the following are both true:
ActiveState is activeSubState is runningisEnabled: boolean - Returns true if service start at boot is enabled, i.e., UnitFileState is enabled or static.status: string - Returns service state as would be displayed in output of systemctl status. Ex.: active (running)FAQs
Systemd interface for NodeJS
We found that node-systemctl demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.