Cronie ships a systemd unit file from version 1.4.9, in the contrib directory. It is the fedora one, but with a very quick sed it can work for gentoo, just need to change sysconfig/crond to conf.d/cronie. Reproducible: Always Steps to Reproduce: 1. emerge cronie 2. # qlist cronie | grep systemd /usr/share/doc/cronie-1.4.9/cronie.systemd.bz2 3. the systemd unit file is there, but compressed and not installed in the correct location.
And the bz2ed unit file is the fedora one, without the mentioned replace applied.
I would distribute the modified unit in $FILESDIR rather than patching the Fedora file. Just the EnvironmentFile needs to be updated.
Ok it works that way too. The reason I propose the patch (well with sed) approach is: you already have a unit file, why not using it just changing the distribution customization path? Also, why add another file to portage which is already very fat? It happen to be a fedora specific file just because cronie is maintained by fedora. You also don't have to maintain systemd changes, you have them for free. But ok this has cons too I guess, it is up to you to choose what is better, this are just my 2 cents :)
Created attachment 335104 [details, diff] patch o apply at the current 1.4.9 ebuild to add systemd support I tried a first implementation to see if it can work. Seems a good start to be, so I share it. Every comment is very welcome.
would it be easier to use the systemd eclass to generate a unit file from scratch rather than patching an existing one ? (i ask, knowing nothing about unit files)
(In reply to comment #5) That seems like a decent idea to me.
Can't do that :(. Creating a unit file is very like creating a modern openrc init script. You have to give the command, args, where to install the service when enabled and few other things. No way to do it automatically. I think it is better to use the fedora one, at least for now, because it is really not tied to fedora except for the configuration path. Systemd is not really distribution centric, so happens quite frequently that what works in one distribution can easly work on other, often with minimal or null mods. That said, if the start shipping something not good for gentoo, we can always start shipping ours. But for now this works and I don't think they plan to change it much... cron is not something really brand new :) Anyway if you really don't like the sed idea, we can just ship the file and be done with it..... but I have no better idea then using the fedora one even in this case just changing the path....
(In reply to comment #7) The method isn't really that important, I just haven't had a chance to test this personally. Once I have, I will commit something to the tree.
(In reply to comment #8) > (In reply to comment #7) > > The method isn't really that important, I just haven't had a chance to test > this personally. Once I have, I will commit something to the tree. Take your time, thank you :)
*cronie-1.4.9-r3 (23 Jan 2013) 23 Jan 2013; Mike Gilbert <floppym@gentoo.org> +cronie-1.4.9-r3.ebuild: Install systemd service unit and hourly anacron file (disabled by default). Bug 450728 by Enrico Tagliavini.