The sample systemd unit file prevents the ZFS integration from working #1114
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What I'm trying to do and why
When trying to use the ZFS integration to make snapshots of backed up directories, while running Borgmatic through the enclosed systemd unit file, one gets permission errors
Steps to reproduce
Actual behavior
Expected behavior
The snapshots should be created successfully
Other notes / implementation ideas
I tracked down the offending unit file settings.
The ZFS dataset listing fails due to the
PrivateDevices=yesline (the borgmatic process loses access to /dev/zfs that way)Snapshotting fails due to the
CapabilityBoundingSet=CAP_DAC_READ_SEARCH CAP_NET_RAWline. I'm not sure which capabilities the ZFS snapshot process needs, but clearing the setting allowed the snapshots to be made.Mounting snapshots is prevented by the
SystemCallFilter=@system-serviceline. Setting it toSystemCallFilter=@system-service @mountallowed the backup to proceed.borgmatic version
1.9.14 (the offending settings are present in the current version's sample unit file too)
borgmatic installation method
Debian package
Borg version
borg 1.2.8
Python version
Python 3.12.3
Database version (if applicable)
No response
Operating system and version
PRETTY_NAME="Ubuntu 24.04.2 LTS" NAME="Ubuntu" VERSION_ID="24.04" VERSION="24.04.2 LTS (Noble Numbat)" VERSION_CODENAME=noble ID=ubuntu ID_LIKE=debian HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" UBUNTU_CODENAME=noble LOGO=ubuntu-logo
Thanks for filing this and providing all the details about the offending system settings. Unfortunately, there's no one-size-fits-all systemd service given all the ways borgmatic can be used. So I think I'm going to treat this as a documentation issue (including potentially the comments in the sample systemd service).
I went ahead and documented this and also added a few relevant comments to the sample systemd service file. Additionally, I added
@mountto theSystemCallFilter=setting as you suggested.Thanks again!