Skip to content

Instantly share code, notes, and snippets.

View dougsland's full-sized avatar
:octocat:
#opensource #upstream

Douglas Landgraf dougsland

:octocat:
#opensource #upstream
View GitHub Profile
@dougsland
dougsland / gist:08c00779f1b27e359370ecfaf42c2a0d
Created September 7, 2023 14:42
BlueChi, dbus-devel and C
dnf install gcc dbus-devel -y
gcc -o list_nodes list_nodes.c -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include/ -ldbus-1
#include <dbus/dbus.h>
#include <stdio.h>
#include <stdlib.h>
void handle_structure(DBusMessageIter *structIter) {
int typeInStruct;
@dougsland
dougsland / README.md
Created October 16, 2023 13:37 — forked from engelmi/README.md
Basic bluechi-agent

Evil BlueChi-Agent

This gist shows a basic frame on how to implement a bluechi-agent for testing purposes only, e.g. as intended in containers/qm#234.

Using Python + DasBus

The python example does not include emitting signals as defined in the introspection data.

Running the example evil_bluechi_agent.py:

[root@localhost ~]# journalctl -r | grep -i systemd
Mar 05 06:21:05 localhost.localdomain systemd[547]: Finished Cleanup of User's Temporary Files and Directories.
Mar 05 06:21:05 localhost.localdomain systemd[547]: Starting Cleanup of User's Temporary Files and Directories...
Mar 05 06:21:05 localhost.localdomain systemd[547]: Created slice User Background Tasks Slice.
Mar 05 06:16:20 localhost.localdomain systemd[1]: systemd-hostnamed.service: Deactivated successfully.
Mar 05 06:15:55 localhost.localdomain systemd[1]: NetworkManager-dispatcher.service: Deactivated successfully.
Mar 05 06:15:50 localhost.localdomain systemd[1]: Started Session 1 of User root.
Mar 05 06:15:50 localhost.localdomain systemd[1]: Started User Manager for UID 0.
Mar 05 06:15:50 localhost.localdomain systemd[547]: Startup finished in 282ms.
Mar 05 06:15:50 localhost.localdomain systemd[547]: Reached target Main User Target.