How to undo %{fillup_only} ?

I’m building a package using %{fillup_only} to place a configuration file at /etc/sysconfig/.

What is the proper method to delete that file upon removal of the package?

Related question: I note that updating the package will not overwrite the existing configuration file at /etc/sysconfig/. That’s good to preserve any existing user configurations, but when the syntax of the configuration file changes I have to replace the old one by the new template. Can I force this?

Hi


%postun  
%{insserv_cleanup}

It should clean it out on rpm removal though?

Just mark as %config in your %files section and don’t use (noreplace).

Thank you. That is it.

Ooops, I was too fast

When I test it I see that it does not remove the config file in /etc/sysconfig/ when I remove the rpm package with yast.

%post
%{fillup_only}

%postun
%{insserv_cleanup}

%files
%defattr(-,root,root,-)
%doc README CHANGELOG LICENSE start.sh
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/www
%dir %{_libdir}/%{name}
%{_bindir}/mjpg_streamer
%{_bindir}/mjpg_streamer_udp_client
%{_bindir}/mstreamer
%{_libdir}/%{name}/*.so
%{_datadir}/%{name}/www/*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/applications/%{name}-udp-client.desktop
%{_datadir}/pixmaps/%name.png
# The format has changed; otherwise use %config(noreplace)
%config /var/adm/fillup-templates/sysconfig.mjpg-streamer
%doc %{_mandir}/man1/mjpg_streamer.1.gz
%doc %{_mandir}/man1/mjpg_streamer_udp_client.1.gz
%doc %{_mandir}/man1/mstreamer.1.gz