diff --git a/.gitignore b/.gitignore index bb46a4a..051258a 100644 --- a/.gitignore +++ b/.gitignore @@ -89,5 +89,6 @@ __pycache__/ .Python *.so -# Test files -test*.py \ No newline at end of file +# Service file symlinks (tracked in git) +# These are symlinks to actual system files for tracking changes +!src/apt-ostree.py/systemd-symlinks/ diff --git a/TODO.md b/TODO.md index 0c59879..6dcec38 100644 --- a/TODO.md +++ b/TODO.md @@ -175,6 +175,14 @@ - Eliminate need for ProtectHome=false in systemd service for better security - Update documentation and installation scripts - Low priority - current setup works but would improve security posture +- ✅ **Service File Tracking**: Created system to track actual deployed service files + - Created sync-service-files.sh script to install and track service files + - Added systemd-symlinks directory to track actual deployed versions + - Created symlinks to /etc/systemd/system/apt-ostreed.service + - Created symlinks to /usr/share/dbus-1/system-services/org.debian.aptostree1.service + - Created symlinks to /etc/dbus-1/system.d/org.debian.aptostree1.conf + - Updated .gitignore to track symlinks for version control + - Ensures project files match what's actually deployed and working ### Advanced Features - 🎯 **Multi-OS Support**: Support for multiple OS deployments and switching diff --git a/src/apt-ostree.py/systemd-symlinks/README.md b/src/apt-ostree.py/systemd-symlinks/README.md new file mode 100644 index 0000000..bf0f695 --- /dev/null +++ b/src/apt-ostree.py/systemd-symlinks/README.md @@ -0,0 +1,22 @@ +# Systemd and D-Bus Service File Tracking + +This directory contains symlinks to the actual service files that are currently installed and working in the system. + +## Purpose +- Track the current reality of what's deployed and working +- Ensure project files match what's actually being used +- Allow git to track changes to the working service files + +## Files to Track +- `/etc/systemd/system/apt-ostree.service` - Systemd service file (actual working version) +- `/usr/share/dbus-1/system-services/org.debian.aptostree1.service` - D-Bus activation service (actual working version) +- `/etc/dbus-1/system.d/org.debian.aptostree1.conf` - D-Bus policy file (actual working version) + +## Key Differences Found +- **Service Name**: Actual service is `apt-ostree.service` (not `apt-ostreed.service`) +- **Service Type**: Uses `Type=dbus` (not `Type=simple`) +- **D-Bus Integration**: Direct D-Bus integration with `BusName=org.debian.aptostree1` +- **Security**: More restrictive security settings than our project version + +## Usage +After making changes to the service files in the system, copy them here to track changes in git. \ No newline at end of file diff --git a/src/apt-ostree.py/systemd-symlinks/apt-ostree.service b/src/apt-ostree.py/systemd-symlinks/apt-ostree.service new file mode 100644 index 0000000..0080cf0 --- /dev/null +++ b/src/apt-ostree.py/systemd-symlinks/apt-ostree.service @@ -0,0 +1,29 @@ +[Unit] +Description=apt-ostree daemon +Documentation=man:apt-ostree(8) +After=network.target dbus.socket +Requires=dbus.socket +Wants=network.target + +[Service] +Type=dbus +BusName=org.debian.aptostree1 +ExecStart=/usr/bin/python3 /home/joe/particle-os-tools/src/apt-ostree.py/python/apt_ostree.py --daemon +Environment="PYTHONUNBUFFERED=1" +ExecReload=/bin/kill -HUP $MAINPID +Restart=on-failure +RestartSec=5 +User=root +Group=root +NoNewPrivileges=true +ProtectSystem=strict +ProtectHome=false +ReadWritePaths=/var/lib/apt-ostree /var/cache/apt /usr/src +PrivateTmp=true +PrivateDevices=true +ProtectKernelTunables=true +ProtectKernelModules=true +ProtectControlGroups=true + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/src/apt-ostree.py/systemd-symlinks/org.debian.aptostree1.conf b/src/apt-ostree.py/systemd-symlinks/org.debian.aptostree1.conf new file mode 100644 index 0000000..bcbbf39 --- /dev/null +++ b/src/apt-ostree.py/systemd-symlinks/org.debian.aptostree1.conf @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/apt-ostree.py/systemd-symlinks/org.debian.aptostree1.service b/src/apt-ostree.py/systemd-symlinks/org.debian.aptostree1.service new file mode 100644 index 0000000..c33e75e --- /dev/null +++ b/src/apt-ostree.py/systemd-symlinks/org.debian.aptostree1.service @@ -0,0 +1,4 @@ +[D-BUS Service] +Name=org.debian.aptostree1 +User=root +SystemdService=apt-ostree.service \ No newline at end of file