Closed sudo-kraken closed 1 hour ago
I ask as when gravity sync updates the secondary with changes it then makes my databases read only as the user can no longer write to them.
I have to exec in and manually alter it with chmod commands for the pihole user, it may be better to alter gravity sync to use names for users and not ID's ?
https://github.com/vmstan/gravity-sync/wiki/Hidden-Figures
LOCAL_FILE_OWNER and REMOTE_FILE_OWNER are probably what you're looking for.
found it thank you :)
Sorry to reopen this but even with these set it is setting the user to 33 on dnsmasq.d folder and the files within to 0 (root) where is it getting 33 from this is also the case on /etc/pihole with it being 33 and only 1 or two files set to 999.
This is using the stock Pi-hole Docker containers?
Yes standard official containers
On Tue, Dec 12, 2023 at 17:28, Michael Stanclift @.***(mailto:On Tue, Dec 12, 2023 at 17:28, Michael Stanclift < wrote:
This is using the stock Pi-hole Docker containers?
โ Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you modified the open/close state.Message ID: @.***>
I also just noticed that my Pi-Hole database is getting Read-Only now too I also use the standard docker container and i have a user "pihole:pihole" (1003:1003)
I updated gravity-sync
gravity-sync update
Edited the conf (/etc/gravity-sync/gravity-sync.conf) with these variables
LOCAL_FILE_OWNER='1003:1003' REMOTE_FILE_OWNER='1003:1003'
Changed the ownership on my PiHoles
sudo chown -R pihole:pihole /opt/pihole
Restarted both the Pi-Holes
Added a Domain successfully through the UI and ran a manual sync
gravity-sync push
dns1:~$ gravity-sync push
โ Initializing Gravity Sync (4.0.5)
โ Loading gravity-sync.conf
โ Detecting local Pi-hole installation
โ Detecting remote Pi-hole installation
โ Gravity Sync remote peer is configured
โ Evaluating arguments: PUSH
ยป Remote target ubuntu@192.168.1.xxx
โ Validating pathways to Pi-hole
โ Validating pathways to DNSMASQ
โ Hashing the remote Gravity Database
โ Comparing to the local Gravity Database
! Differences detected in the Gravity Database
โ Hashing the remote DNS Records
โ Comparing to the local DNS Records
โ Comparing to the local DNS Records
โ Hashing the remote DNS CNAMEs
โ Comparing to the local DNS CNAMEs
! Static DHCP Addresses not detected on the local Pi-hole
! Replication of Pi-hole settings is required
โ Performing backup of remote Gravity Database
โ Performing backup of local Gravity Database
โ Checking Gravity Database copy integrity
โ Pushing the local Gravity Database
โ Setting file ownership on Gravity Database
โ Setting file permissions on Gravity Database
โ Performing backup of remote DNS Records
โ Performing backup of local DNS Records
โ Pushing the local DNS Records
โ Setting file ownership on DNS Records
โ Setting file permissions on DNS Records
โ Performing backup of remote DNS CNAMEs
โ Performing backup of local DNS CNAMEs
โ Pushing the local DNS CNAMEs
โ Setting file ownership on DNS CNAMEs
โ Setting file permissions on DNS CNAMEs
โ Updating remote FTLDNS configuration
โ Reloading remote FTLDNS services
โบ Performing replicator diagnostics
โ Rehashing the remote Gravity Database
โ Recomparing to local Gravity Database
โ Rehashing the remote DNS Records
โ Recomparing to local DNS Records
โ Recomparing to local DNS Records
โ Rehashing the remote DNS CNAMEs
โ Recomparing to local DNS CNAMEs
! Static DHCP Addresses not detected on the local Pi-hole
โ Saving updated data hashes
โ Sending hashes to Gravity Sync peer
โ Setting permissions on remote hashing files
โ Logging successful PUSH
โ Gravity Sync PUSH completed after 137 seconds
The ownership on my database files has changed again..but its working now; so not really sure whats going on
-rw-rw-r-- 1 systemd-coredump ubuntu 96100352 Dec 23 11:50 pihole-FTL.db
Overnight it went back to Read-Only. A Straight reboot helped, so not sure if this is more of a PiHole Docker issue, more than a gravity-sync one...
Edit: Resolved by using the PIHOLE_UID and PIHOLE_GID environment variables in the Environment Variables in the Pi-Hole docker container. Set them to my 'pihole' user that the container is running as on my Docker host and now the database stops going Read-only. I guess something changed as I never needed that before.
Effective July 26, 2024, this project has been retired. Thank you for your use and enthusiasm for a project that began as a few lines of bash in a Slack channel and envolved into something far more complex, and used by many thousands of Pi-hole enthusiasts over the last four years.
I cant update my UID and GID to use for each pi hole instance as they run as non standard ID's i.e primary = 1000 and 988 and Secondary runs on 1000 and 997
Is there a way to update this ?