Mailinglist Archive: opensuse-packaging (129 mails)

< Previous Next >
Re: [opensuse-packaging] Advice for moving a conf file

On Saturday 2015-04-04 13:21, Bruno Friedmann wrote:
On Saturday 04 April 2015 11.07:20 Jan Engelhardt wrote:

Previously the configuration file was in /etc/collectd.conf
Now the systemd service file is expecting it in /etc/collectd/collectd.conf
The old init script is still pointing to /etc/collectd.conf
What would be the best approach (especially for migration)

Method #4:
%post
if [ ! -e /etc/collectd/collectd.conf ]; then
ln -s ../collectd.conf /etc/collectd/; fi


That is what was used for "moving" /etc/sysctl.conf to
/etc/sysctl.d/99-local.conf.


I would like to be sure, when the .rpmnew .rpmsave is taking place to not
replace an existing configuration.

If in %post, when new release are installed an placing at the correct place
/etc/collectd/collectd.conf isn't it too late then to detect a previous
configuration ?

This method presumes that the %files list retains /etc/collectd.conf as it
currently does, so there is no modification of collectd.conf, you only add
the missing symlink to support the new way. Users can then, once they find
time and joy, replace the symlink indirection.
--
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-packaging+owner@xxxxxxxxxxxx

< Previous Next >