Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

Commit

Permalink
ctdb-packaging: Stop RPM from renaming working config to ctdb.rpmsave
Browse files Browse the repository at this point in the history
The change to ctdbd.conf and removal of /etc/sysconfig/ctdb as a
configuration file makes RPM rename the latter with a .rpmsave suffix.
This means that a working configuration is moved aside on upgrade and
manual intervention is needed.

Avoid this by convincing RPM that the existing /etc/sysconfig/ctdb is
still a configuration file.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12125

Signed-off-by: Martin Schwenke <[email protected]>
Reviewed-by: Amitay Isaacs <[email protected]>

Autobuild-User(master): Martin Schwenke <[email protected]>
Autobuild-Date(master): Mon Aug  8 11:30:58 CEST 2016 on sn-devel-144
  • Loading branch information
martin-schwenke authored and Martin Schwenke committed Aug 8, 2016
1 parent d7ecc91 commit 464b386
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ctdb/packaging/RPM/ctdb.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,15 @@ DESTDIR=$RPM_BUILD_ROOT ./buildtools/bin/waf install

install -m644 config/ctdbd.conf $RPM_BUILD_ROOT%{_sysconfdir}/ctdb

# Add a pointer to modern location for configuration file. Allow with
# "noreplace" in the files section, this stops RPM moving aside a
# working configuration.
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
cat >$RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ctdb <<EOF
# CTDB configuration is now in %{_sysconfdir}/ctdb/ctdbd.conf
EOF
chmod 644 $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ctdb

%if %{with_systemd}
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
install -m 755 config/ctdb.service $RPM_BUILD_ROOT%{_unitdir}
Expand Down Expand Up @@ -151,6 +160,8 @@ rm -rf $RPM_BUILD_ROOT
%config(noreplace) %{_sysconfdir}/ctdb/gcore_trace.sh
%config(noreplace) %{_sysconfdir}/ctdb/debug_locks.sh

%config(noreplace, missingok) %{_sysconfdir}/sysconfig/ctdb

%if %{with_systemd}
%{_unitdir}/ctdb.service
%else
Expand Down

0 comments on commit 464b386

Please sign in to comment.