[opensuse-packaging] Advice for moving a conf file
Hi I need an advice about one of the package I normally maintain. collectd https://build.opensuse.org/package/show/server:monitoring/collectd Upstream now give a real systemd service file to start the daemon. 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) In pre, test if /etc/collectd.conf exist and move it the /etc/collectd (which exist but empty) patch upstream make install patch upstream systemd service file Any comments appreciate. -- Bruno Friedmann Ioda-Net Sàrl www.ioda-net.ch openSUSE Member & Board, fsfe fellowship GPG KEY : D5C9B751C4653227 irc: tigerfoot -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
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. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
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 ? -- Bruno Friedmann Ioda-Net Sàrl www.ioda-net.ch openSUSE Member & Board, fsfe fellowship GPG KEY : D5C9B751C4653227 irc: tigerfoot -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
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@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Sat, Apr 4, 2015 at 6:07 AM, Jan Engelhardt <jengelh@inai.de> 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 strongly suggest you use method 4 suggested by Jan here. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Sat, 4 Apr 2015 21:47, Cristian Rodríguez wrote:
On Sat, Apr 4, 2015 at 6:07 AM, 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 strongly suggest you use method 4 suggested by Jan here.
And, if possible make notice of this location change in the package changelog, this helps later on. Thank you for the time invested. - Yamaban.
participants (4)
-
Bruno Friedmann
-
Cristian Rodríguez
-
Jan Engelhardt
-
Yamaban