Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 450728 - >=sys-process/cronie-1.4.9 should provide a systemd unit file
Summary: >=sys-process/cronie-1.4.9 should provide a systemd unit file
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal enhancement
Assignee: Lars Wendler (Polynomial-C) (RETIRED)
URL: http://git.fedorahosted.org/cgit/cron...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-07 17:39 UTC by Enrico Tagliavini
Modified: 2013-01-23 01:08 UTC (History)
3 users (show)

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


Attachments
patch o apply at the current 1.4.9 ebuild to add systemd support (cronie-systemd.patch,1.14 KB, patch)
2013-01-10 20:44 UTC, Enrico Tagliavini
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Enrico Tagliavini 2013-01-07 17:39:16 UTC
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.
Comment 1 Enrico Tagliavini 2013-01-07 17:40:46 UTC
And the bz2ed unit file is the fedora one, without the mentioned replace applied.
Comment 2 Mike Gilbert gentoo-dev 2013-01-07 18:30:41 UTC
I would distribute the modified unit in $FILESDIR rather than patching the Fedora file. Just the EnvironmentFile needs to be updated.
Comment 3 Enrico Tagliavini 2013-01-07 20:16:55 UTC
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 :)
Comment 4 Enrico Tagliavini 2013-01-10 20:44:40 UTC
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.
Comment 5 SpanKY gentoo-dev 2013-01-10 21:38:23 UTC
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)
Comment 6 Mike Gilbert gentoo-dev 2013-01-10 21:55:46 UTC
(In reply to comment #5)

That seems like a decent idea to me.
Comment 7 Enrico Tagliavini 2013-01-10 21:57:24 UTC
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....
Comment 8 Mike Gilbert gentoo-dev 2013-01-10 22:00:03 UTC
(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.
Comment 9 Enrico Tagliavini 2013-01-10 22:27:16 UTC
(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 :)
Comment 10 Mike Gilbert gentoo-dev 2013-01-23 01:08:59 UTC
*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.