[Starlingx-discuss] [multi-os] replace "/etc" in config files by a variable "sysconfdir"

Saul Wold sgw at linux.intel.com
Mon Oct 1 14:55:19 UTC 2018



On 10/01/2018 07:22 AM, Penney, Don wrote:
> There are a set of defined RPM macros already available:
> 
> https://fedoraproject.org/wiki/Packaging:RPMMacros
> 
> For example, /etc should be replaced with %{_sysconfdir} in the spec files.
> 
This issue is not in the specfiles, but in other files that have /etc 
hardcoded in them (.ini or .conf files).  We would need to replace the 
hardcoded /etc with a token (sysconfdir) that can be modified (by sed 
likely) during installation.  This modification would use the 
%{_sysconfdir}, in RPM case to replace the token in the config file.

This would be true of other hardcoded path variables we might find along 
the way.

Sau!

> *From:*Hu, Yong [mailto:yong.hu at intel.com]
> *Sent:* Friday, September 28, 2018 8:24 PM
> *To:* starlingx-discuss at lists.starlingx.io
> *Subject:* [Starlingx-discuss] [multi-os] replace "/etc" in config files 
> by a variable "sysconfdir"
> 
> As a part of initiatives, I would like to suggest to replace “/etc”, 
> which is hardcoded in some StarlingX config files,
> 
> by a variable something like “sysconfdir”, which would be “instantiated” 
> a bit later upon the OS type (CentOS, ClearLinux or Ubuntu).
> 
> Taking “stx-nfv/nfv/nfv-vim/nfv_vim/config.ini” as an example,
> 
> “/etc” is coded in this “config.ini” directly to refer other config files:
> 
> config_file=/etc/nfv/nfv_plugins/alarm_handlers/config.ini
> 
> config_file=/etc/nfv/nfv_plugins/nfvi_plugins/config.ini
> 
> My recommendation is to use a variable “sysconfdir” as instead, and to 
> “define” this variable on later stage,
> 
> like in “nfv.spec” for CentOS, in which “sysconfdir” is “/etc”.
> 
> The benefit I see here is in other OSs, such as Clear Linux in which we 
> can set different value,
> 
> for example, “/usr/local/etc” for this variable “sysconfdir”.
> 
> Should you have any questions or feedback, please let me know.
> 
> If I don’t see objections with this kind of changes, I will make some 
> patches accordingly afterward.
> 
> 
> 
> _______________________________________________
> Starlingx-discuss mailing list
> Starlingx-discuss at lists.starlingx.io
> http://lists.starlingx.io/cgi-bin/mailman/listinfo/starlingx-discuss
> 



More information about the Starlingx-discuss mailing list