Permissions not sticking for RRD folder

Every time I add a new device, it creates the RRD files as root:root and I have to manually run the fix suggested by validate.php.

[FIX] sudo chown -R librenms:librenms /opt/librenms
sudo setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
sudo chmod -R ug=rwX /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/

I have to run those commands every time… How can I fix this?
I also get this message from validate.php which I assume is also permissions related since I have plenty of drive space: [WARN] Disk space where /opt/librenms/rrd is located is less than 512Mb
Help is appreciated!
Thanks!

How are you adding the device? I assume via ./addhost.php as root user?

My bad - I was adding through the web interface, but then was impatient and was running ./discovery.php and ./poller.php right after from the command line. If I wait and let it run the first time automatically it creates correctly with librenms:librenms.
However, I still have the message " [WARN] Disk space where /opt/librenms/rrd is located is less than 512Mb" when I run validate.php from command line or web interface. I have over 200GB free. Any ideas what’s wrong there?
Thanks!

Only do this as the librenms user. If “whoami” does not say librenms, you will need to change to that user using the best way for your particular distribution. (sudo/su)