Project

Profile

Help

Issue #669

pulp-server rpm treats init.d files as configs

Added by cduryee almost 7 years ago. Updated almost 2 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
2.6 Beta
Platform Release:
2.6.1
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Easy Fix, Pulp 2
Sprint:
Quarter:

Description

Description of problem:

The pulp spec file contains the following:

  1. 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.

+ This bug was cloned from Bugzilla Bug #1183700 +

History

#1 Updated by bmbouter almost 7 years ago

PR available at: https://github.com/pulp/pulp/pull/1560

+ This comment was cloned from Bugzilla #1183700 comment 1 +

#2 Updated by bmbouter almost 7 years ago

Merged to 2.6-testing -> 2.6-dev -> master

+ This comment was cloned from Bugzilla #1183700 comment 2 +

#3 Updated by bmbouter almost 7 years ago

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.

+ This comment was cloned from Bugzilla #1183700 comment 3 +

#4 Updated by cduryee almost 7 years ago

2.6.0-0.7.beta

+ This comment was cloned from Bugzilla #1183700 comment 4 +

#5 Updated by igulina@redhat.com almost 7 years ago

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=""

  1. 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 comment was cloned from Bugzilla #1183700 comment 5 +

#6 Updated by cduryee almost 7 years ago

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.

+ This comment was cloned from Bugzilla #1183700 comment 6 +

#7 Updated by cduryee almost 7 years ago

Moving to 2.6.1, files will be upgraded as expected when upgrading to 2.6.1.

+ This comment was cloned from Bugzilla #1183700 comment 7 +

#8 Updated by bmbouter almost 7 years ago

  • Severity changed from Medium to 2. Medium

#9 Updated by pthomas@redhat.com over 6 years ago

  • Status changed from 5 to 6

verified
as per chris's comment above looks like what we see after upgrade is as expected


[root@qe-blade-13 ~]# 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
[root@qe-blade-13 ~]# 
[root@qe-blade-13 ~]# 
[root@qe-blade-13 ~]# 
[root@qe-blade-13 ~]# 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. 
[root@qe-blade-13 ~]# grep "comment" /etc/init.d/pulp_resource_manager
#This is a comment
[root@qe-blade-13 ~]# 
[root@qe-blade-13 ~]# ls -la /etc/init.d/pulp*
-rwxr-xr-x. 1 root root  7472 May  4 16:22 /etc/init.d/pulp_celerybeat
-rwxr-xr-x. 1 root root  8291 May  6 09:09 /etc/init.d/pulp_celerybeat.rpmsave
-rwxr-xr-x. 1 root root   862 May  6 09:09 /etc/init.d/pulp_resource_manager
-rwxr-xr-x. 1 root root  9353 May  4 16:22 /etc/init.d/pulp_workers
-rwxr-xr-x. 1 root root 10116 May  6 09:09 /etc/init.d/pulp_workers.rpmsave
[root@qe-blade-13 ~]# 

<\pre>

#10 Updated by dkliban@redhat.com over 6 years ago

  • Status changed from 6 to CLOSED - CURRENTRELEASE

#12 Updated by bmbouter almost 3 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF