Translate

Image of Beginning Google Maps API 3
Image of RHCE Red Hat Certified Engineer Linux Study Guide (Exam RH302) (Certification Press)
Image of Modern Operating Systems (3rd Edition)
Image of Linux Kernel Development (3rd Edition)

Revisiting Systemd D-Bus Interfaces

In a May 2013 blog post I examined the then systemd D-Bus interface. At that time the systemd version string was 208. In this short blog I will discuss hostnamectl/hostnamed and timedatectl/timedatectl functionality as it relates to the systemd Dbus. You can use the following dbus-send command to find out what’s available on the D-Bus system bus: # dbus-send –system –print-reply –dest=”org.freedesktop.DBus” \ /org/freedesktop/DBus org.freedesktop.DBus.ListActivatableNames method return sender=org.freedesktop.DBus -> dest=:1.137 reply_serial=2 array [ string “org.freedesktop.DBus” string “org.freedesktop.login1” string “org.fedoraproject.Setroubleshootd” string “org.freedesktop.machine1” string “org.freedesktop.ColorManager” string “com.redhat.problems.configuration” string “org.freedesktop.systemd1” string “org.freedesktop.Avahi” string “org.freedesktop.PolicyKit1” string “org.freedesktop.ModemManager1” string “org.bluez” string “org.freedesktop.hostname1” string “org.freedesktop.NetworkManager” string

PackageKit D-Bus Abstraction Layer

PackageKit uses an abstraction layer to allow a session user to manage software packages in a secure way. This abstraction layer is based on D-Bus. Essentially, it is a set of APIs exported through a D-Bus interface. Glib, qt and python and other language bindings are available. This abstraction layer enables applications to perform high-level package operations such as add or remove a package without having to know much about package management. PolicyKit (AKA PolKit) is incorporated to provide a fine grained policy mechanism for users. D-Bus has two connections types (buses): System and Session. System interfaces normally run as

Exploring Systemd D-Bus Interface

Systemd is a system and service manager for Linux, compatible with System V and LSB init scripts. Systemd provides aggressive parallelization capabilities, uses socket and D-Bus activation for starting services, offers on-demand starting of daemons, keeps track of processes using Linux control groups, supports snapshotting and restoring of the system state, maintains mount and automount points and implements an elaborate transactional dependency-based service control logic. D-Bus is enabled automatically when using systemd because D-Bus is a dependency of systemd. Here, I use dbus-send to introspect the systemd D-Bus interface. # dbus-send –system –print-reply –reply-timeout=2000 –type=method_call \ –dest=org.freedesktop.systemd1 /org/freedesktop/systemd1 \ org.freedesktop.DBus.Introspectable.Introspect

Restarting GNOME Shell Extension From Command Line

You can restart a GNOME Shell extension from the command line using D-Bus. For example: $ gdbus call –session –dest org.gnome.Shell –object-path /org/gnome/Shell –method org.gnome.Shell.Extensions.ReloadExtension Any utility that enables you to generate a D-Bus message can be used – not just gdbus.

GNOME Shell 3.4 DBus Interface

Many people are unaware that the GNOME Shell has a DBus interface which can be used to programmatically interact with the GNOME Shell. Here is the DBus interface for GNOME Shell 3.4 (see shellDBus.js): const GnomeShellIface = <interface name="org.gnome.Shell"> <method name="Eval"> <arg type="s" direction="in" name="script" /> <arg type="b" direction="out" name="success" /> <arg type="s" direction="out" name="result" /> </method> <method name="ListExtensions"> <arg type="a{sa{sv}}" direction="out" name="extensions" /> </method> <method name="GetExtensionInfo"> <arg type="s" direction="in" name="extension" /> <arg type="a{sv}" direction="out" name="info" /> </method> <method name="GetExtensionErrors"> <arg type="s" direction="in" name="extension" /> <arg type="as" direction="out" name="errors" /> </method> <method name="ScreenshotArea"> <arg type="i" direction="in" name="x"/> <arg type="i" direction="in"