#!/bin/bash echo "=== Debugging D-Bus Interface ===" # Kill existing daemon sudo pkill -f apt-ostreed 2>/dev/null || true sleep 2 # Start daemon echo "Starting daemon..." sudo /usr/libexec/apt-ostreed & DAEMON_PID=$! sleep 3 echo "Daemon PID: $DAEMON_PID" # Check D-Bus registration echo "" echo "1. Checking D-Bus registration..." if busctl list | grep org.aptostree.dev > /dev/null; then echo "✅ Daemon registered on D-Bus" else echo "❌ Daemon not registered on D-Bus" exit 1 fi # Introspect the interface echo "" echo "2. Introspecting D-Bus interface..." busctl introspect org.aptostree.dev /org/aptostree/dev/Daemon > /tmp/dbus-introspect.txt 2>&1 if [ $? -eq 0 ]; then echo "✅ Introspection successful" echo "Available methods:" grep "method" /tmp/dbus-introspect.txt | head -10 else echo "❌ Introspection failed" cat /tmp/dbus-introspect.txt fi # Test each method individually echo "" echo "3. Testing individual methods..." echo "Testing ping..." busctl call org.aptostree.dev /org/aptostree/dev/Daemon org.aptostree.dev.Daemon ping 2>&1 echo "Testing status..." busctl call org.aptostree.dev /org/aptostree/dev/Daemon org.aptostree.dev.Daemon status 2>&1 echo "Testing list_packages..." busctl call org.aptostree.dev /org/aptostree/dev/Daemon org.aptostree.dev.Daemon list_packages 2>&1 echo "Testing search_packages..." busctl call org.aptostree.dev /org/aptostree/dev/Daemon org.aptostree.dev.Daemon search_packages "apt" false 2>&1 echo "" echo "4. Testing CLI..." echo "CLI ping:" apt-ostree daemon-ping 2>&1 echo "CLI status:" apt-ostree daemon-status 2>&1 echo "" echo "=== Debug Complete ===" echo "To stop daemon: sudo kill $DAEMON_PID"