RRDtool 1.7.1 Released - Fixes Permissions Bug

#1

Since most OpenNMS users rely on RRDtool, OpenNMS repositories contain later versions than are often supported by the operating system distribution.

An interesting problem was found in RRDtool 1.7.0 that has been fixed in RRDtool 1.7.1. While it is doubtful most users will experience the issue, it is recommended to upgrade to 1.7.1 if using 1.7.0.

The bug was caused by code introduced in 1.7.0 explicitly setting the umask for files created with librrd. This would cause some random permissions to be set, quite often removing all permissions from the file owner. This won’t affect most people because they run OpenNMS as root, but in environments where OpenNMS is not running as root, it would cause issues as file could no longer be updated.

Permissions issues were found in the following directories:

  • $OPENNMS_HOME/data/tmp
  • $OPENNMS_HOME/share/rrd
  • $OPENNMS_HOME/logs

Here is an example of the issue in the logs directory:

Note that for a number of log files the owner has no permissions.

As mentioned, running OpenNMS using RRDtool 1.7.0 as root doesn’t cause issues since root has the ability to update all files, but upgrading to 1.7.1 is a good idea just in case. To fix permissions after the upgrade, run the following commands:

  • Stop OpenNMS (sudo systemctl stop opennms)
  • sudo rm -rf $OPENNMS_HOME/logs/*
  • sudo rm -rf $OPENNMS_HOME/data/tmp/*
  • cd $OPENNMS_HOME/share/rrd
  • sudo find . -type d -exec chmod 755 {} \;
  • sudo find . -name "*rrd" -exec chmod 644 {} \;
  • sudo find . -name "*meta" -exec chmod 644 {} \;
  • Start OpenNMS (sudo systemctl opennms start)

This was a tricky one to find and luckily it only affected a small number of users.

3 Likes