#!/bin/bash echo "=== Quick Fix for apt-ostree Daemon ===" # Kill any existing daemon processes echo "1. Stopping any existing daemon processes..." sudo pkill -f apt-ostreed 2>/dev/null || true sleep 2 # Copy latest binaries echo "2. Installing latest binaries..." sudo cp target/release/apt-ostreed /usr/libexec/ 2>/dev/null || echo "Warning: Could not copy daemon binary" sudo cp target/release/apt-ostree /usr/bin/ 2>/dev/null || echo "Warning: Could not copy CLI binary" # Reload D-Bus echo "3. Reloading D-Bus..." sudo systemctl reload dbus # Start daemon manually echo "4. Starting daemon manually..." sudo /usr/libexec/apt-ostreed & DAEMON_PID=$! sleep 3 # Check if daemon started if kill -0 $DAEMON_PID 2>/dev/null; then echo "✅ Daemon started successfully (PID: $DAEMON_PID)" # Test D-Bus communication echo "5. Testing D-Bus communication..." sleep 2 if busctl call org.aptostree.dev /org/aptostree/dev/Daemon org.aptostree.dev.Daemon Ping 2>/dev/null; then echo "✅ D-Bus communication working!" echo "" echo "🎉 Daemon is working correctly!" echo "" echo "You can now test with:" echo " apt-ostree daemon-ping" echo " apt-ostree daemon-status" echo " apt-ostree list" echo "" echo "To stop the daemon: sudo kill $DAEMON_PID" else echo "❌ D-Bus communication failed" echo "Checking D-Bus status..." busctl list | grep apt || echo "No apt services found" fi else echo "❌ Daemon failed to start" echo "Checking for error messages..." sudo journalctl -u apt-ostreed.service --no-pager -n 5 2>/dev/null || echo "No journal entries found" fi