diff mbox

[ovs-dev,3/6] redhat: make the rpm aware of the lock file

Message ID 20170603151001.19716-4-aconole@redhat.com
State Superseded
Headers show

Commit Message

Aaron Conole June 3, 2017, 3:09 p.m. UTC
Currently, the db lockfile will cause the openvswitch directory to
linger after uninstall because the rpm database isn't aware that it
should be treated as part of the system.  This commit informs the rpmdb
properly as a 'ghost' so that when the package is uninstalled, it will
be removed automatically.  This means that if no extra files exist in
/etc/openvswitch, the whole directory will be removed from /etc/.

Signed-off-by: Aaron Conole <aconole@redhat.com>
---
 rhel/openvswitch-fedora.spec.in | 2 ++
 1 file changed, 2 insertions(+)

Comments

Flavio Leitner June 7, 2017, 9 p.m. UTC | #1
On Sat, Jun 03, 2017 at 11:09:58AM -0400, Aaron Conole wrote:
> Currently, the db lockfile will cause the openvswitch directory to
> linger after uninstall because the rpm database isn't aware that it
> should be treated as part of the system.  This commit informs the rpmdb
> properly as a 'ghost' so that when the package is uninstalled, it will
> be removed automatically.  This means that if no extra files exist in
> /etc/openvswitch, the whole directory will be removed from /etc/.
> 
> Signed-off-by: Aaron Conole <aconole@redhat.com>
> ---

This looks unrelated to the userspace work as the previous patch,
other than that it looks good to me.

Acked-by: Flavio Leitner <fbl@sysclose.org>
Markos Chandras June 9, 2017, 8:40 a.m. UTC | #2
On 07/06/17 22:00, Flavio Leitner wrote:
> On Sat, Jun 03, 2017 at 11:09:58AM -0400, Aaron Conole wrote:
>> Currently, the db lockfile will cause the openvswitch directory to
>> linger after uninstall because the rpm database isn't aware that it
>> should be treated as part of the system.  This commit informs the rpmdb
>> properly as a 'ghost' so that when the package is uninstalled, it will
>> be removed automatically.  This means that if no extra files exist in
>> /etc/openvswitch, the whole directory will be removed from /etc/.
>>
>> Signed-off-by: Aaron Conole <aconole@redhat.com>
>> ---
> 
> This looks unrelated to the userspace work as the previous patch,
> other than that it looks good to me.
> 
> Acked-by: Flavio Leitner <fbl@sysclose.org>
> 

Reviewed-by: Markos Chandras <mchandra@suse.de>
diff mbox

Patch

diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in
index 95533aa..fe6f15f 100644
--- a/rhel/openvswitch-fedora.spec.in
+++ b/rhel/openvswitch-fedora.spec.in
@@ -273,6 +273,7 @@  rm -rf $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/
 install -d -m 0755 $RPM_BUILD_ROOT/%{_sharedstatedir}/openvswitch
 
 touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/conf.db
+touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/.conf.db.~lock~
 touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/system-id.conf
 
 install -p -m 644 -D selinux/openvswitch-custom.pp \
@@ -481,6 +482,7 @@  fi
 %{_sysconfdir}/bash_completion.d/ovs-vsctl-bashcomp.bash
 %dir %{_sysconfdir}/openvswitch
 %config %ghost %{_sysconfdir}/openvswitch/conf.db
+%ghost %{_sysconfdir}/openvswitch/.conf.db.~lock~
 %config %ghost %{_sysconfdir}/openvswitch/system-id.conf
 %config(noreplace) %{_sysconfdir}/sysconfig/openvswitch
 %config(noreplace) %{_sysconfdir}/logrotate.d/openvswitch