Shouqun / node-dbus

dbus module for node
MIT License
150 stars 70 forks source link

How to Start and Stop systemd services through dbus? #236

Open AliSawari opened 2 years ago

AliSawari commented 2 years ago

I tried to connect to the bus and run commands but with each time trying to connect to systemd, the program runs into infinite loop.

const dbus = require("dbus");

const someBus = dbus.getBus('system');

someBus.getInterface('org.freedesktop.systemd1',
  '/org/freedesktop/systemd1',
  (err, interface) => {
  if (err) throw new Error(err)
  console.log(interface)
})
sergeylukin commented 1 year ago

.getInterface expects 4 arguments, you're missing the interface value