Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm trying to make my RPM to preserve configuration files, if these exist.

The behavior should be like MySQL or Lighttpd, where new configuration files, if the old ones are present, are saved with the extension .rpmnew.

Any idea how to best to achieve this?


locked by HopelessN00b Feb 15 at 5:20

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

1 Answer 1

up vote 4 down vote accepted

RPM does this automatically for files marked with the %config attribute in your spec file. Exactly what happens depends on whether the configuration file has been modified locally and whether you have used just %config or %config(noreplace).

Read more here.

For less specific, but more 'official' see: –  Scott Pack Dec 13 '10 at 21:28
Thanks for the advice! –  SyRenity Dec 14 '10 at 11:51

Not the answer you're looking for? Browse other questions tagged or ask your own question.