diff --git a/syslogd.changes b/syslogd.changes index be2afad..72a4eef 100644 --- a/syslogd.changes +++ b/syslogd.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Aug 31 12:40:57 UTC 2022 - Stefan Schubert + +- Migration to /usr/etc: Saving user changed configuration files + in /etc and restoring them while an RPM update. + ------------------------------------------------------------------- Tue Jun 21 12:20:58 UTC 2022 - Stefan Schubert diff --git a/syslogd.spec b/syslogd.spec index 9522385..04c2844 100644 --- a/syslogd.spec +++ b/syslogd.spec @@ -340,6 +340,20 @@ rm -f %{_sysconfdir}/systemd/system/multi-user.target.wants/syslog.service %pre -n syslog-service %service_add_pre klog.service +%if 0%{?suse_version} > 1500 +# Prepare for migration to /usr/etc; save any old .rpmsave +for i in logrotate.d/syslog ; do + test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i}.rpmsave.old ||: +done +%endif + +%if 0%{?suse_version} > 1500 +%posttrans -n syslog-service +# Migration to /usr/etc, restore just created .rpmsave +for i in logrotate.d/syslog ; do + test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i} ||: +done +%endif %postun -n syslog-service %service_del_postun klog.service