Bug 1960184

Summary: An upgrade stomps on /etc/sysconfig/postgrey
Product: [Fedora] Fedora EPEL Reporter: Nick <nick>
Component: postgreyAssignee: Fabio Alessandro Locati <me>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: epel7CC: comzeradd, i, me, vascom2
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-13 11:11:38 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:

Description Nick 2021-05-13 09:16:09 UTC
Description of problem:
Upgrading postgrey stomps on an existing /etc/sysconfig/postgrey

Version-Release number of selected component (if applicable):
/etc/sysconfig/postgrey

How reproducible:
Always

Steps to Reproduce:
1.Install an older version of postgrey
2.Edit something in /etc/sysconfig/postgrey
3.Upgrade postgrey

Actual results:
You get a new /etc/sysconfig/postgrey

Expected results:
/etc/sysconfig/postgrey should not change

Proposed solution:
In the spec file %files section, change:
%{_sysconfdir}/sysconfig/postgrey

to:
%config(noreplace) %{_sysconfdir}/sysconfig/postgrey

Comment 1 Nick 2021-05-13 11:11:03 UTC
Hmm. It may be necessary as the file has changed. previously a simple:
POSTGREY_OPTS="--delay=300 --max-age=35"

was fine. Now it seems you have to set further options as the systemd unit file has changed or the start up options have. It would have been nicer to have a %config noreplace and a smart %post to add in the other parameters.

I'll mark the bug as invalid.

Comment 2 Nick 2021-05-13 12:58:26 UTC
From the mailing list:

In that case, shouldn't we change the line to
   %config %{_sysconfdir}/sysconfig/postgrey
so that the old file is saved at
   %{_sysconfdir}/sysconfig/postgrey.rpmsave
? 

I think that would be better so at least the old values could be recovered