Hi! So, a couple months ago they added systemd support for snapper. This included a helper program for systemd, along with multiple service and timer units for systemd, intended for installation by the package manager. The ebuild and the distfiles for snapper that are used in portage however, lack both of these despite the fact systemd support is supposed to be in 0.2.4. I did some further investigation, and it seems that none of these files are in the distfiles because openSUSE actually strips them out before providing them for download on their servers. If you download the source from the original GitHub page for snapper, all of these files are included (you can also see the timer and service units I'm talking about here: https://github.com/openSUSE/snapper/tree/master/ ). Of course, without these files snapper can't really be used on systemd systems without additional effort.
Yes, that seems to be right, the tarballs in ftp://ftp.suse.com/pub/projects/snapper/ don't seem to contain systemd units, while the tarballs from their GitHub repository do (unfortunately the latter doesn't contain configure scripts). This won't be an issue for the live ebuild, of course, but the situation with the SUSE tarball is odd. I'll ask upstream about it.
Fixed it. https://github.com/openSUSE/snapper/pull/141
That would resolve the issue, of course, but I'd assume upstream had a reason not to include those files in the first place. Perhaps they don't feel it's ready yet. Hopefully they'll have some input on it soon.
(In reply to Dainius Masiliūnas from comment #3) Or they just forgot to update Makefile.am; that seems far more likely.
OK, looks like you were right. The next release tarball should have the files; however, there doesn't seem to be a way to have them installed automatically, nor a configure flag to toggle between systemd timers and cron scripts at the moment. I'd assume that it would be preferable to have USE flags to toggle between the two, as they have the same functionality and thus conflict with each other.
Not really a discussion for this bug, but we should really figure out what we want to do with timer units vs cron scripts. Systemd users can potentially use either, and since not everything supplies timer units they probably are either running cron or a wrapper like systemd-cron. I suppose we could install both. The timer unit won't do anything unless enabled. The problem is that cron scripts DO work by default if you're processing the cron.d directories, unless you make that configurable (eg read a flag from conf.d). We're basically stuck with this problem since we're trying to be init/cron agnostic.
(In reply to Richard Freeman from comment #7) For the moment, it should be sufficient to install the timers and let the sysadmin enable them. If they are running a cron daemon, they can make a decision on whether to enable the timers or not.
(In reply to Mike Gilbert from comment #8) But how do they know that enabling the timer can cause conflicts with the cron scripts? And how do they know which cron scripts to disable, if they want to do so? And last I checked, there was no nice way of disabling them to begin with.
(In reply to Dainius Masiliūnas from comment #9) I generally assume a basic level of aptitude using systemd; I assume people know how to run systemctl enable. As for disabling cron scripts, chmod -x should to the job. I'm certainly not opposed to spelling it out in a postinst message or README file if you want to do that.
(In reply to Mike Gilbert from comment #10) > > As for disabling cron scripts, chmod -x should to the job. Does config protection actually preserve that if the file doesn't change?
(In reply to Richard Freeman from comment #11) > Does config protection actually preserve that if the file doesn't change? No. See bug 523706.
I'd dare say it's rather uncommon to mix cron and timer units. So if one decides to switch to the latter, he converts the remaining cron files to systemd timers, and likely disables cron completely. There's also INSTALL_MASK.
(In reply to Michał Górny from comment #13) > I'd dare say it's rather uncommon to mix cron and timer units. So if one > decides to switch to the latter, he converts the remaining cron files to > systemd timers, and likely disables cron completely. There's also > INSTALL_MASK. I'll agree with that. I went the systemd-cron route (I really need to get that in the tree if somebody didn't beat me to it), and run a mix of timers and cron jobs, mainly preferring cron jobs for scripts supplied by packages. If the bulk of the tree were migrated to timers I'd probably disable cron entirely.
Yes, I can agree with that too. I typically don't install cron in systemd systems to begin with; my Snapper systems were the exception before now. So perhaps some warnings should be displayed if one tries to install a cron while running systemd?
Apparently even though the files are now in the archive, they're not actually being installed by the Makefile. Sigh. Opened a new pull request for that: https://github.com/openSUSE/snapper/pull/154
(In reply to Dainius Masiliūnas from comment #16) > Apparently even though the files are now in the archive, they're not > actually being installed by the Makefile. Sigh. Opened a new pull request > for that: > https://github.com/openSUSE/snapper/pull/154 Any way we can just copy the files over in the ebuild for the mean time until the pull request gets merged?
Unfortunately the systemd-helper isn't pulled in either. It's now fixed upstream, though, so the live ebuild should already have all of that. I'll just need to test it and add some notices for systemd users about how to enable the timers.
Created attachment 398224 [details, diff] snapper-9999.patch OK, I tested the live ebuild, and indeed it seems to work fine, the units are installed. Here's a patch for the live ebuild to give more information to users about how to enable the snapshotting and what to do in case they have a cron installed. I'm testing for cronbase, which should catch all cron users as it's the base for all cron ebuilds. Though it's not ideal as it also catches the users of systemd-cron, which is unfortunate but in this case necessary, I believe. If this looks good, then it should also be incorporated into the regular ebuilds starting from 0.2.7.
anyone from @systemd team can ACK this patch and commit to tree? (I do not have machine using systemd) also should we at least fix one of most recent version? say 0.2.6 here? or ask upstream do a bug-fix release (he did last time when I ask).
Snapper has just been bumped to 0.2.7 upstream (although not tagged yet): https://github.com/openSUSE/snapper/commit/e2621e1e455f038d43efa40a135966940327ad31 This includes everything needed for native timers, so the patch should be applied to the upcoming 0.2.7 ebuild too.
This has long been fixed, I've been using systemd timers since 0.3.3. Marking as fixed.