Ask Your Question
1

ROS_ETC_DIR usage

asked 2014-02-03 15:41:53 -0500

I'd like to take advantage of the ROS_ETC_DIR in some packages, but I have a few points of confusion about it:

  • My reading of REP-123 suggests that ROS_ETC_DIR should be /etc/ros (or /etc/ros/hydro), but it's actually /opt/ros/hydro/etc/ros.
  • When I have an overlay workspace, and I source the workspace's devel/setup.bash, ROS_ETC_DIR still just points to /opt/ros/hydro/etc/ros
  • When I make the install space, I see install/etc get generated. However, when I source install/setup.bash, I still get ROS_ETC_DIR pointing to /opt/ros/hydro/etc/ros.
  • In the install space, if I create a directory for my package, it is findable using catkin_find mypackage --etc

Is the theory that in develspace, anything I would be putting in the etc folder will just be in my source and thus findable that way? What about files which are templated or otherwise generated? Should they hang out in devel or is a generated configuration file a sign that I am doing something wrong?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-02-04 03:06:06 -0500

joq gravatar image

updated 2014-02-04 04:53:06 -0500

I have no official answer. This is just my personal understanding of the situation regarding /etc.

Current ROS behavior using /opt/ros/hydro/etc/ros seems to violate the Linux Filesystem Hierarchy Standard, because setting $PREFIX=/usr would place things under /usr/etc, which is specifically disallowed. Since people seldom build ROS with that prefix, the problem is more potential than acute.

We still have not resolved that problem. It requires some REP updates, and came up too late in the Hydro release cycle. It should probably be discussed now and fixed in Indigo.

There are relatively few ROS packages installing files using ${CATKIN_PACKAGE_ETC_DESTINATION}. They need to be looked at on a case-by-case basis, but my feeling is that most of them should use ${CATKIN_PACKAGE_SHARE_DESTINATION} instead. That probably helps solve most of the issues you mentioned with access to both generated and source files.

There is a separate issue with packages for managing entire robots, like some of yours. For them, there are cases where things like upstart files need to be installed under the system /etc directory. That was never handled by ROS_ETC_DIR, anyway. We need to specify how and when such operations are appropriate.

EDIT: Bloom support for conffiles is a bigger problem, best discussed in your issue #226. The problem remains that neither ${CATKIN_PACKAGE_ETC_DESTINATION} nor ${CATKIN_PACKAGE_SHARE_DESTINATION} are appropriate for admin-customizable configuration data.

As far as I know, no standard forbids putting default config data in ${CATKIN_PACKAGE_SHARE_DESTINATION}/etc, but as you know it needs special handling to avoid getting overwritten by apt-get.

Common Linux practice would probably install them in the global /etc/package_name directory, then provide a ~/.package_name for per-user settings.

edit flag offensive delete link more

Comments

1

For installing upstart jobs and udev rules, yes, we just copy them into `/etc` as an absolute path regardless. This is not cross-platform, but upstart and udev are peculiarities of Ubuntu regardless, so the cross-platform consideration is not as much in play.

mikepurvis gravatar image mikepurvis  ( 2014-02-04 04:20:40 -0500 )edit

The specific reason to want etc over share is to make it clear that the file is intended to be user-alterable configuration, despite originating from package management. I've filed a ticket regarding this behaviour: https://github.com/ros-infrastructure/bloom/issues/226 .

mikepurvis gravatar image mikepurvis  ( 2014-02-05 09:53:53 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2014-02-03 15:41:53 -0500

Seen: 155 times

Last updated: Feb 04 '14