Bug 738154

Summary: postgresql.service alters during software upgrade
Product: [Fedora] Fedora Reporter: arkhnchul <arkhnchul>
Component: postgresqlAssignee: Tom Lane <tgl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 16CC: devrim, elad, hhorak, tgl
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-09-14 08:24:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description arkhnchul 2011-09-14 07:29:23 UTC
Description of problem:
during upgrade of postgresql-server package the /lib/systemd/system/postgresql.service file, containing some configured environmental variables for postgres, became overwritten instead creating a .rpmnew file.

Version-Release number of selected component (if applicable):
postgresql-server-9.1.0-1.fc16.i686

How reproducible:

Steps to Reproduce:
1. change PGDATA in /lib/systemd/system/postgresql.service
2. upgrade postgresql-server package
  
Actual results:
/var/lib/pgsql/data as PGDATA in /lib/systemd/system/postgresql.service

Expected results:
having actual configured postgresql.service file and postgresql.service.rpmnew from upgraded package, like as another config files belonging to packages being upgraded.

Additional info:

Comment 1 Elad Alfassa 2011-09-14 07:49:15 UTC
In my opinion, this is not a bug.
If you want to customize the service file, you should do it in /etc/systemd/system and not it /lib/systemd/system.
just copy the service file to the /etc location, and change it however you want. systemd will use the service file from the /etc location.

Comment 2 Honza Horak 2011-09-14 08:09:36 UTC
(In reply to comment #1)
> If you want to customize the service file, you should do it in
> /etc/systemd/system and not it /lib/systemd/system.
> just copy the service file to the /etc location, and change it however you
> want. systemd will use the service file from the /etc location.

Yes, this is the right approach. More info about systemd:
http://www.freedesktop.org/wiki/Software/systemd/FrequentlyAskedQuestions
http://0pointer.de/public/systemd-man/

Comment 3 arkhnchul 2011-09-14 08:24:21 UTC
hmm, thanks

Comment 4 Tom Lane 2011-09-14 14:50:03 UTC
(In reply to comment #1)
> In my opinion, this is not a bug.
> If you want to customize the service file, you should do it in
> /etc/systemd/system and not it /lib/systemd/system.
> just copy the service file to the /etc location, and change it however you
> want. systemd will use the service file from the /etc location.

Yes, that is the design the systemd folk have foisted on us.  IMO it's not a good design, because it fails to consider the likelihood that the packager will need to change the service file from time to time.  But it's not for the postgresql package to do things differently than the Fedora packaging guidelines say.  You might care to open up a bug against systemd pointing out that they need a better design for customized service files.

Comment 5 arkhnchul 2011-09-14 16:07:22 UTC
i think that old /etc/sysconfig/* way was much better than current systemd method... before now we should not have been edit /etc/init.d/ scripts, when needed to change some config or environment variable, huh.