Description of problem: The pulp spec file contains the following: # Install the init scripts %defattr(755,root,root,-) %config %{_initddir}/pulp_celerybeat %config %{_initddir}/pulp_workers %config %{_initddir}/pulp_resource_manager This causes manual changes to the init.d files to not be overwritten during RPM upgrades as expected. Instead, a .rpmsave file is created. The %config directive should be removed so .rpmsave is not created. Version-Release number of selected component (if applicable): 2.6.0 beta 5 How reproducible: every time Steps to Reproduce: 1. install pulp 2. edit /etc/rc.d/init.d/pulp_workers (perhaps add an extra newline somewhere) 3. upgrade pulp-server rpm - you can probably use "rpm -Uvh --oldpackage" to do this without waiting for a new version:) Actual results: A new pulp_workers file is created as /etc/rc.d/init.d/pulp_workers.rpmsave Expected results: The pulp_workers file with the manual change should be overwritten. Additional info: This only occurs if someone makes a change to the init.d file. If they do not, it gets upgraded normally.
PR available at: https://github.com/pulp/pulp/pull/1560
Merged to 2.6-testing -> 2.6-dev -> master
QE to verify this you should test it with an upgrade on EL6. 1. Start with an older version of 2.4 <= Pulp <= 2.5 2. Add a bash comment to each of the files. /etc/init.d/pulp_celerybeat, /etc/init.d/pulp_workers, and /etc/init.d/pulp_resource_manager 3. Also add a bash comment to /etc/default/pulp_celerybeat, /etc/default/pulp_workers, and /etc/default/pulp_resource_manager. 3. Upgrade to the tested version of Pulp 4. Verify that your comment is no longer present in the files contained at /etc/init.d/ 5. Verify that your comment is still present in the files contained at /etc/default/ 6. Verify that *.rpmsave files have been created in /etc/default/. I'm not 100% sure on step 6, but I included for completeness. Steps 4 and 5 should definitely work. If Step 6 does not work ping me with a needsinfo.
2.6.0-0.7.beta
Failed QA 1) My added comment remains in /etc/init.d/pulp_resource_manager 2) File /etc/init.d/pulp_resource_manager.rpmsave has not been created >> rpm -qa pulp-server pulp-server-2.4.4-0.4.rc.el6.noarch >> echo "#This is a comment" >> /etc/init.d/pulp_resource_manager >> echo "#This is a comment" >> /etc/init.d/pulp_workers >> echo "#This is a comment" >> /etc/init.d/pulp_celerybeat >> tail -n 5 /etc/init.d/pulp_celerybeat ;; esac exit 0 #This is a comment >> echo "#This is a comment" >> /etc/default/pulp_celerybeat >> echo "#This is a comment" >> /etc/default/pulp_workers >> echo "#This is a comment" >> /etc/default/pulp_resource_manager >> tail -n 5 /etc/default/pulp_resource_manager DEFAULT_NODES="" # For the resource_manager, this should be set to 0. PULP_CONCURRENCY=0 #This is a comment >> vi /etc/yum.repos.d/rhel-pulp.repo to enable pulp 2.6 repo >> yum upgrade ... >> rpm -qa pulp-server pulp-server-2.6.0-0.7.beta.el6.noarch >> tail -n 5 /etc/init.d/pulp_workers exit 64 # EX_USAGE ;; esac exit 0 >> grep "comment" /etc/default/* /etc/default/pulp_celerybeat:#This is a comment /etc/default/pulp_resource_manager:#This is a comment /etc/default/pulp_workers:#This is a comment >> grep "comment" /etc/init.d/* /etc/init.d/functions:# paths; it doesn't have to handle comments in fstab_file. /etc/init.d/pulp_celerybeat.rpmsave:#This is a comment /etc/init.d/pulp_resource_manager:#This is a comment /etc/init.d/pulp_workers.rpmsave:#This is a comment /etc/init.d/smartd:# Uncomment the line below to pass options to smartd on startup. >> grep "comment" /etc/init.d/pulp_resource_manager #This is a comment >> ls -la /etc/init.d/pulp* -rwxr-xr-x. 1 root root 7124 Feb 10 16:15 /etc/init.d/pulp_celerybeat -rwxr-xr-x. 1 root root 8308 Feb 18 10:57 /etc/init.d/pulp_celerybeat.rpmsave -rwxr-xr-x. 1 root root 879 Feb 18 10:57 /etc/init.d/pulp_resource_manager -rwxr-xr-x. 1 root root 9328 Feb 10 16:15 /etc/init.d/pulp_workers -rwxr-xr-x. 1 root root 10133 Feb 18 10:57 /etc/init.d/pulp_workers.rpmsave
This is expected behavior. For the init.d scripts: The %config directive applies to the existing file install when upgrading. In this case: * pulp_celerybeat had %config, was updated between pulp 2.4 and 2.6, *and* had local on-disk changes. Thus, it gets updated. * pulp_resource_manager had %config, was not updated between pulp 2.4 and 2.6, thus rpm will not even check the filesystem. It assumes that if there are local changes, they are OK since the file in the RPM didn't change. Note that if you do an "rpm -Uvh --oldpackage pulp-server-2.6.0-0.7.beta.el6.noarch.rpm", the existing state of the init.d files will not have %config, and will get updated. This would also apply for future updates to pulp-server. For the /etc/default files: The files did not change between Pulp 2.4 and 2.6. Thus, any local changes will persist on-disk. These files are marked as %config(noreplace), which means that if there are changes to the files *and* local changes, the new file will be saved as *.rpmnew. If you'd like to discuss on IRC, just let me know. It is a little confusing:) Moving BZ back to ON_QA.
Moving to 2.6.1, files will be upgraded as expected when upgrading to 2.6.1.
Moved to https://pulp.plan.io/issues/669