Bug #1398

System configuration files are expected in /etc/ instead of $prefix/etc

Added by J. Moringen over 11 years ago. Updated about 11 years ago.

Status:ResolvedStart date:02/05/2013
Priority:NormalDue date:
Assignee:J. Wienke% Done:

100%

Category:C++
Target version:rsb-0.9

Associated revisions

Revision 3b43b511
Added by J. Moringen about 11 years ago

Use install prefix to find configuration file in src/rsb/Factory.cpp

fixes #1398

Based on patch by Johannes Wienke.

  • src/rsb/Factory.cpp: updated copyright; pass result of
    installPrefix() to rsc::config::configure
  • src/rsb/Version.{h,cpp}.in: added function installPrefix

History

#1 Updated by J. Wienke about 11 years ago

  • Status changed from New to In Progress
  • Assignee set to J. Wienke

#2 Updated by J. Wienke about 11 years ago

Jan, there is an implementation in the feature branch. Can you have a look whether that solves the problem?

#3 Updated by J. Moringen about 11 years ago

One of the three configure calls in Factory::Factory() does not use the prefix. Is this intentional?

#4 Updated by J. Wienke about 11 years ago

  • % Done changed from 0 to 80

No, fixed in branch. I will also modify the documentation accordingly. Is it ok then?

#5 Updated by J. Wienke about 11 years ago

Can you please have a look at the documentation in the feature branch. This was kind of hard to modify the graph correctly.

#6 Updated by J. Moringen about 11 years ago

  • Status changed from In Progress to Feedback

I initially misread the change. Also, I cannot find a version of rsc::config::configure which accepts a prefix as final parameter. Did you not yet push it into the Robotics Systems Commons repository?

Looking at the documentation change (and studying the rsb::Factory change more carefully), I'm afraid, I had a different solution in mind. Your proposed solution would process /etc/FILENAME as well as PREFIX/etc/FILENAME, right?

My complaint in this issue is that PREFIX/etc/FILENAME should be processed instead of /etc/FILENAME. Maybe we can make the prefix parameter in rsc::config::configure optional and add an optional prefix parameter to rsc::config::systemConfigDirectory as well. When no prefix is provided, rsc::config::systemConfigDirectory could use RSC's CMAKE_INSTALL_PREFIX instead of /etc/. rsb::Factory could call rsc::config::configure with RSB's prefix in case the two libraries are installed in different prefixes.

What do you think?

#7 Updated by J. Wienke about 11 years ago

Sorry, the RSC changes are pushed now.

Actually I understand the immediate reaction, but when implementing this I didn't see any drawbacks of also using the general file in /etc/. It would be inconsistent to ignore the file in the installation prefix, but I don't see why it is inconsistent to also use the global configuration file. E.g. if someone switches from a debian package to a manually installed version for using some custom modifications, no changes would be necessary to continue with the old configuration he set up with this solutions. Do you see a real problem in also parsing the global config file?

#8 Updated by J. Moringen about 11 years ago

  • Status changed from Feedback to Resolved
  • % Done changed from 80 to 100

Applied in changeset rsb-cpp|commit:3b43b5110e1641f6a56be62175d7085adb168c74.

Also available in: Atom PDF