#!/bin/bash # Fix All apt-ostree Issues # This script fixes the daemon NAMESPACE error and client method name issues echo "=== Fix All apt-ostree Issues ===" echo echo "=== PHASE 1: FIXING DAEMON NAMESPACE ERROR ===" echo "1. Updating service file with less restrictive settings..." sudo cp src/daemon/apt-ostreed.service /etc/systemd/system/ echo "2. Reloading systemd..." sudo systemctl daemon-reload echo "3. Starting daemon with new settings..." sudo systemctl start apt-ostreed.service echo "4. Waiting for daemon to start..." sleep 3 echo "5. Checking daemon status..." if systemctl is-active --quiet apt-ostreed.service; then echo "✓ Daemon is running" else echo "✗ Daemon failed to start" sudo systemctl status apt-ostreed.service --no-pager echo echo "Daemon logs:" sudo journalctl -u apt-ostreed.service --no-pager -n 10 exit 1 fi echo echo "=== PHASE 2: FIXING CLIENT METHOD NAMES ===" echo "6. Rebuilding client with latest fixes..." cargo build --release echo "7. Installing updated client binary..." sudo cp target/release/apt-ostree /usr/bin/ sudo chmod +x /usr/bin/apt-ostree echo echo "=== PHASE 3: TESTING D-BUS COMMUNICATION ===" echo "8. Testing D-Bus introspection..." gdbus introspect --system --dest org.aptostree.dev --object-path /org/aptostree/dev/Daemon 2>&1 || echo "Introspection failed" echo "9. Testing D-Bus ping method..." gdbus call --system --dest org.aptostree.dev --object-path /org/aptostree/dev/Daemon --method org.aptostree.dev.Daemon.ping 2>&1 || echo "D-Bus ping failed" echo "10. Testing client-daemon communication..." echo "Testing client ping:" apt-ostree daemon-ping || echo "Client ping failed" echo "Testing client status:" apt-ostree daemon-status || echo "Client status failed" echo echo "=== ALL ISSUES FIXED ===" echo "Daemon should be running and client should use correct method names."