Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 533984 - app-backup/snapper missing systemd files
Summary: app-backup/snapper missing systemd files
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Dainius Masiliūnas
URL: https://github.com/openSUSE/snapper/p...
Whiteboard:
Keywords:
Depends on: 539562
Blocks: install-systemd-unit
  Show dependency tree
 
Reported: 2014-12-30 01:32 UTC by Chandler Paul
Modified: 2018-02-10 10:13 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
snapper-9999.patch (file_533984.txt,1.50 KB, patch)
2015-03-06 11:49 UTC, Dainius Masiliūnas
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chandler Paul 2014-12-30 01:32:43 UTC
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.
Comment 1 Dainius Masiliūnas 2014-12-30 15:51:50 UTC
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.
Comment 2 Mike Gilbert gentoo-dev 2014-12-30 16:20:50 UTC
Fixed it.

https://github.com/openSUSE/snapper/pull/141
Comment 3 Dainius Masiliūnas 2014-12-30 16:40:08 UTC
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.
Comment 4 Mike Gilbert gentoo-dev 2014-12-30 16:48:17 UTC
(In reply to Dainius Masiliūnas from comment #3)

Or they just forgot to update Makefile.am; that seems far more likely.
Comment 5 Mike Gilbert gentoo-dev 2014-12-30 16:48:22 UTC
(In reply to Dainius Masiliūnas from comment #3)

Or they just forgot to update Makefile.am; that seems far more likely.
Comment 6 Dainius Masiliūnas 2014-12-31 13:03:02 UTC
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.
Comment 7 Richard Freeman gentoo-dev 2014-12-31 13:22:16 UTC
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.
Comment 8 Mike Gilbert gentoo-dev 2014-12-31 16:27:17 UTC
(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.
Comment 9 Dainius Masiliūnas 2014-12-31 17:29:01 UTC
(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.
Comment 10 Mike Gilbert gentoo-dev 2014-12-31 17:43:31 UTC
(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.
Comment 11 Richard Freeman gentoo-dev 2014-12-31 17:57:49 UTC
(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?
Comment 12 Mike Gilbert gentoo-dev 2014-12-31 18:00:19 UTC
(In reply to Richard Freeman from comment #11)
> Does config protection actually preserve that if the file doesn't change?

No. See bug 523706.
Comment 13 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-12-31 18:06:36 UTC
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.
Comment 14 Richard Freeman gentoo-dev 2014-12-31 19:31:02 UTC
(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.
Comment 15 Dainius Masiliūnas 2015-01-01 13:30:28 UTC
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?
Comment 16 Dainius Masiliūnas 2015-03-01 22:17:38 UTC
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
Comment 17 Chandler Paul 2015-03-05 22:23:31 UTC
(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?
Comment 18 Dainius Masiliūnas 2015-03-05 23:04:48 UTC
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.
Comment 19 Dainius Masiliūnas 2015-03-06 11:49:47 UTC
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.
Comment 20 Yixun Lan archtester gentoo-dev 2015-03-06 14:36:32 UTC
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).
Comment 21 Dainius Masiliūnas 2015-05-22 18:50:17 UTC
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.
Comment 22 Dainius Masiliūnas 2018-02-10 10:13:25 UTC
This has long been fixed, I've been using systemd timers since 0.3.3. Marking as fixed.