Bug 1654659

Summary: Optimize cronie RPM spec for systemd requirements when installing it in containers
Product: [Fedora] Fedora Reporter: Bogdan Dobrelya <bdobreli>
Component: cronieAssignee: Tomas Mraz <tmraz>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: bdobreli, hguemar, ltoscano, mmaslano, tmraz
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: cronie-1.5.2-4.fc30 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1654672 1663456 1671362 (view as bug list) Environment:
Last Closed: 2018-11-30 10:36:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1663456    
Attachments:
Description Flags
patch
none
a better patch
none
final patch none

Description Bogdan Dobrelya 2018-11-29 11:18:58 UTC
Created attachment 1509776 [details]
patch

Description of problem:

When installing cronie into a container image, it is preferable to use the systemd_ordering macro.

According to https://fedoraproject.org/wiki/Packaging:Scriptlets:
If a package is suitable for installation without systemd (in a
container image, for example) and does not require any of the
systemd mechanisms such as tmpfiles.d, then the systemd_ordering macro
MAY be used instead of the systemd_requires macro. 

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Bogdan Dobrelya 2018-11-29 11:20:58 UTC
It would be also very nice to have this for Fedora28. Please let me know if I have to clone this bug for that release? (Not sure what to do to the patch then, I submitted it against master of https://src.fedoraproject.org/rpms/cronie repo, and I can see no stable branches there)

Comment 2 Panu Matilainen 2018-11-29 11:21:47 UTC
This has nothing to do with rpm.

Comment 3 Bogdan Dobrelya 2018-11-29 11:30:07 UTC
Created attachment 1509789 [details]
a better patch

this version of the patch also covers SUSE and RHEL distros

Comment 4 Bogdan Dobrelya 2018-11-29 11:32:34 UTC
@Panu, I'm sorry I was confused by the 'rpm' path used in the repo URL https://src.fedoraproject.org/rpms/cronie :)

Comment 5 Tomas Mraz 2018-11-30 08:39:19 UTC
What would be the point of installing cronie into a container where systemd is not present? This is a system service which cannot be started without systemd.

Also we do not ship anything that is specific to other distros than Fedora and RHEL in Fedora package spec so the SUSE part is irrelevant.

Comment 6 Bogdan Dobrelya 2018-11-30 10:01:18 UTC
@Tomas, in TripleO (OpenStack installer) we have containers that run crond and consume tasks from /var/spool/cron (puppet generates those via the tooling we have in tripleo to trigger puppet in config-containers https://review.openstack.org/#/c/478919/5/docker/docker-puppet.py), like in this example https://review.openstack.org/#/c/485865/2/docker/services/heat-api.yaml@94

So that should be working totally w/o having systemd in containers AFAICT.

Comment 7 Bogdan Dobrelya 2018-11-30 10:08:57 UTC
Created attachment 1510097 [details]
final patch

Comment 8 Tomas Mraz 2018-11-30 10:27:38 UTC
OK, then.

Comment 9 Bogdan Dobrelya 2018-11-30 10:40:43 UTC
Thank you Tomas! What else shall I do to have it also accepted into fc28?

Comment 10 Tomas Mraz 2018-11-30 10:49:06 UTC
I wonder if it is really a safe change to do in already released Fedoras.

Comment 11 Bogdan Dobrelya 2018-11-30 13:20:44 UTC
It would be very nice to have this for f28-stabilized as well.

Comment 12 Bogdan Dobrelya 2019-01-23 10:42:12 UTC
JFYI the final patch was https://src.fedoraproject.org/rpms/cronie/c/4d665d4d53f8e2be58f3e64442714c1990cde05d?branch=master
Thanks for helping!