Librenms/docker - RRD file ownership

Hi guys,

I’m running librenms/docker and have noticed a potential issue with RRDCached:

Adding a new device via the GUI results in a file being created in the librenms/rrd directory as expected. I’m running all librenms processes as librenms:librenms based on the UUID and GUID entries specified in the .env file, which I can also confirm using ps -ef | grep librenms (it is running all services including rrdcached). The issue is that the file for the new device in the librenms/rrd directory is owned by the root user, which means that once it is added, it can no longer be accessed by rrdcached:

Manually updating the permissions to librenms:librenms fixes it, but I can’t do that for every device each time I add one. Is it possible to ensure that librenms adds new files within rrd as the user which is running the process, rather than root (which I assume is what Docker defaults to…?).

I can’t recreate this. What is your process for adding a new device? Have you modified the docker?

Hey @murrant - I’m adding a new device via the LibreNMS GUI using the normal Add Device button. It appears to work OK from the GUI perspective (no errors shown when adding), but the graphs don’t work for new devices and I see a load of permissions errors in the logs when RRD tries to update the librenms/rrd/devicename folder. When I update permissions on the folder to librenms:librenms, it all starts to work.

I haven’t updated the Docker container itself - but I did specify the LibreNMS user and group in the .env file that docker-compose uses (it defaults to 1000:1000 - these do not exist on my system and result in the same RRD issue).

I can do a quick screen share if you want to see - it takes a couple of minutes.

I have the exact same issue.
I have not modified any dockers.

I’ve built a fresh Ubuntu 18 server. I’m using the librenms/docker instructions.
Once everything is running , graphs do not create.
What I’m seeing is that when you add a device from the http://HOSTNAME:8000/addhost page, the device directory is created as root:root , in /var/librenms/librenms/rrd/(device dir)

Logs show rrdcached can’t write to the newly created directory.

If I chown to the user associated with the $PUID, then it works.

This is fixed now Error with new device added - no graphs · Issue #76 · librenms/docker · GitHub :slight_smile:

1 Like

Confirmed - thanks!