docs: add D-Bus policy requirements, automate policy install, improve install.sh robustness
This commit is contained in:
parent
10884eacb6
commit
3d11430795
3 changed files with 55 additions and 0 deletions
|
|
@ -7,6 +7,42 @@ rpm-ostree uses a comprehensive D-Bus architecture with three main interfaces:
|
|||
- `org.projectatomic.rpmostree1.OS` - Operating system management
|
||||
- `org.projectatomic.rpmostree1.Transaction` - Transaction management
|
||||
|
||||
## D-Bus Policy File Requirement
|
||||
|
||||
The apt-ostree daemon requires a D-Bus policy file to be installed on the system for proper operation. Without this, the daemon will not be able to claim its service name on the system bus and will fail with an error like:
|
||||
|
||||
```
|
||||
org.freedesktop.DBus.Error.AccessDenied: Connection ":1.XXX" is not allowed to own the service "org.debian.aptostree1" due to security policies in the configuration file
|
||||
```
|
||||
|
||||
### Installation Location
|
||||
- The policy file must be installed as `/etc/dbus-1/system.d/org.debian.aptostree1.conf` (or in `/usr/share/dbus-1/system.d/` on some systems).
|
||||
|
||||
### Example Policy File
|
||||
```xml
|
||||
<!DOCTYPE busconfig PUBLIC
|
||||
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
|
||||
<busconfig>
|
||||
<policy user="root">
|
||||
<allow own="org.debian.aptostree1"/>
|
||||
</policy>
|
||||
<policy context="default">
|
||||
<allow send_destination="org.debian.aptostree1"
|
||||
send_interface="org.debian.aptostree1"/>
|
||||
<allow send_destination="org.debian.aptostree1"
|
||||
send_interface="org.freedesktop.DBus.Introspectable"/>
|
||||
<allow send_destination="org.debian.aptostree1"
|
||||
send_interface="org.freedesktop.DBus.Properties"/>
|
||||
</policy>
|
||||
</busconfig>
|
||||
```
|
||||
|
||||
### Troubleshooting
|
||||
- If you see `AccessDenied` errors, ensure the policy file is present and correct, then reload D-Bus:
|
||||
- `sudo systemctl reload dbus`
|
||||
- The daemon must be started as root to claim the system bus name.
|
||||
|
||||
## Key D-Bus Files in Source Code
|
||||
|
||||
### Primary D-Bus Definition Files
|
||||
|
|
|
|||
|
|
@ -171,6 +171,20 @@ systemctl daemon-reload
|
|||
|
||||
echo -e "${GREEN}✓ Systemd reloaded${NC}"
|
||||
|
||||
# Install D-Bus policy file
|
||||
echo -e "${BLUE}Installing D-Bus policy file...${NC}"
|
||||
DBUS_POLICY_SRC="$(dirname "$0")/dbus-policy/org.debian.aptostree1.conf"
|
||||
DBUS_POLICY_DEST="/etc/dbus-1/system.d/org.debian.aptostree1.conf"
|
||||
if [[ -f "$DBUS_POLICY_SRC" ]]; then
|
||||
cp "$DBUS_POLICY_SRC" "$DBUS_POLICY_DEST"
|
||||
chmod 644 "$DBUS_POLICY_DEST"
|
||||
echo -e "${GREEN}\u2713 D-Bus policy file installed${NC}"
|
||||
echo -e "${BLUE}Reloading D-Bus...${NC}"
|
||||
systemctl reload dbus || echo -e "${YELLOW}Warning: Could not reload dbus. You may need to reboot or reload manually.${NC}"
|
||||
else
|
||||
echo -e "${YELLOW}Warning: D-Bus policy file not found at $DBUS_POLICY_SRC. D-Bus integration may not work!${NC}"
|
||||
fi
|
||||
|
||||
# Test installation
|
||||
echo -e "${BLUE}Testing installation...${NC}"
|
||||
if "$INSTALL_DIR/apt-ostree" --help >/dev/null 2>&1; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue