libdnf icon indicating copy to clipboard operation
libdnf copied to clipboard

Missing integration with snapper for auto-snapshotting

Open Conan-Kudo opened this issue 7 years ago • 4 comments

Today, if someone is using the Btrfs filesystem and has Snapper set up along with the DNF plugin for snapper, the filesystem will automatically be snapshotted on each action that modifies the operating system.

However, this only works with DNF. Anything that uses the underlying libdnf library directly doesn't get this benefit, which leads to the unexpected surprise that there's missing snapshots of the system when PackageKit does software updates (GNOME Software, Plasma Discover, Apper, plasma-pk-updates, pkcon, etc.).

Obviously, this doesn't apply to all use-cases of libdnf (@cgwalters' RPM-OSTree doesn't particularly need this), but we need a way to dynamically offer this capability at runtime.

One way to do this would be with a plugin system, as #202 proposed. Perhaps that should be revived? Alternatively, Snapper support could be a compile time option that builds out a private library (like how GNOME Software and PackageKit do it) and that can be subpackaged out so that it's not always available.

Whatever way we choose to do this, we do need to solve this problem. It's quite annoying and inconsistent.

Reference: Mageia bug 21319

Conan-Kudo avatar Jul 22 '17 12:07 Conan-Kudo

@Conan-Kudo I hope that DNF5 will solve this in the future. Until then, I see one solution - a plugin for the libdnf context - via the plugin API I created some time ago.

But, what is this https://code.opensuse.org/microos/libdnf-plugin-txnupd/blob/master/f/src/txnupd.cpp? Are you already writing such a plugin?

jrohel avatar Jan 20 '21 15:01 jrohel

The txnupd plugin is a different thing, and doesn't solve the use-case being asked here.

Conan-Kudo avatar Jan 20 '21 15:01 Conan-Kudo

Today I created the libdnf "snapper" plugin. https://github.com/rpm-software-management/libdnf/pull/1120 However, it is only a prototype. I didn't test it. I don't have snapper support installed on my computer. I just looked at the "snapper" source code https://github.com/openSUSE/snapper.

jrohel avatar Jan 26 '21 14:01 jrohel

@Conan-Kudo I hope that DNF5 will solve this in the future.

@jrohel do you mean this issue is already solved in DNF 5?

liferooter avatar May 18 '21 03:05 liferooter