Skip to content

Basic usage

Markus Enax edited this page Aug 27, 2016 · 26 revisions

When using this library all communication between your application and the systemd daemon is done via D-Bus. Thus at first a connection to either the system or the user (session) daemon is required. Both can be achieved via the 'Systemd' class.

The following code establishes a connection to the system daemon.

import de.thjom.java.systemd.Systemd;

Systemd systemd = new Systemd();

try {
    systemd.connect();
}
catch (DBusException e) {
    // ...
}

Clone this wiki locally