gravity-sync
gravity-sync copied to clipboard
Systemctl not detected on this system (Unraid)
Quite simple Unraid does not have systemctl. Is there a workaround for this requirement?
its also failing to detect the docker install on unraid
Systemd/systemctl commands are required for automation to work.
It's possible the Docker binaries are in a different location in Unraid. I'm not familiar with that platform.
Are you running the official Docker image from the Pi-hole team?
Is it possible to disable it as a requirement? I am happy to manually automate.
Tis the official image
Does it need to be set up on both, Is setting it up on one OK for a slave set up?
@DuzAwe my upgrade on unraid worked despite the fact that I got that same error during the migration.
What I'm concerned about now is that since Unraid pulls all files from the boot USB on every reboot that the new install location won't persist after a reboot. Previously I had this installed into it's own share under /mnt/user/appdata/gravity-sync. Then I used the User-Scripts plugin to schedule the cron.
I think I'm going to have to reinstall from scratch and see how it goes. I had the previous version 3.x working perfectly.
There will be a Docker version coming here soon (it technically exists I just haven't made it work as intended yet) that should probably solve a lot of these issues.
@justinsangoi very same set up here. After a night of sleep I came up with a few quick solutions, I have a local copy of the install script that I have just set the check count to -1.....I was too lazy to edit out the script. I have then set user scripts to rsync the /etc install to my /mnt/user/appdata/gravity-sync an run all my commands as /mnt/user/appdata/gravity-sync/gravity-sync ***comand in user scripts.
Not sure how it will work for updates but for automation and not having to reinstall after a reboot(rare but they happen). It Works as the old install.
@vmstan That's cool look forward to the hands-off docker option 👍
@DuzAwe Your rsync solution seems like the simplest solution to the problem.
For clarification, are you rsyncing the script to/from /usr/local/bin/ and the configuration files to/from /etc/gravity-sync?
Thinking how I might set mine up, I was thinking I could just add the rsync commands for keeping those files in sync to my User-Script for executing gravity-sync. That way, it would run the rsync prior to any execution of gravity sync - ensuring that the files are always where they are supposed to be. It should also work when I run gravity-sync update, because if using the correct flags rsync will do a bidirectional sync and prefer the newest files.
I too look forward to a Dockerized solution, but I do think an option to specify a custom path for install would be beneficial for unique systems like Unraid.
@justinsangoi there is a .gs fodler in /etc/gravity-sync that contains gravity sync. So just the whole directory so it like this.
rsync -av /mnt/user/scripts/Gravity/gravity-sync /etc/gravity-sync/ chmod +x /etc/gravity-sync/.gs/gravity-sync /etc/gravity-sync/.gs/Waitgravity-sync
Oh you have to reverse that rsync command first.
Then the command is run on array start up
Seems like the copy of gravity-sync in /usr/local/bin is a duplicate (ie. it's not a symbolic or hard link - you can check hard links with the stat command).
To make sure the command can be used from anywhere in the shell would you not also need to rsync that one as well?
rsync doesn't do bi-directional syncing by default, so we'd need to do a series of rsync commands to have this happen, but it's probably easiest to rsync the install directory (/etc/gravity-sync/) to our storage directory first as part of our "upgrade/update" process.
Then have the user-script do the rsync from our storage directory to /etc/gravity-sync/ and an rsync to copy the script itself from .gs/ to /usr/local/bin/. Then run the gravity-sync command itself.
In summary: After update of gravity sync - rsync from /etc/gravity/ to storage location (in my case /mnt/user/appdata/gravity-sync)
Then, in User-Script which runs as my cron job:
- rsync storage directory to /etc/gravity/
- set permissions on the script in /etc/gravity/.gs/
- rsync the script to /usr/local/bin (OR create a hardlink)
- set the permissions on that script
- execute gravity-sync with your action of choice (gravity-sync smart)
I think that would work.
I ran into this problem as well.. I have 2 piholes that I would like to sync, one is running on unraid with its own ipvlan address with default ports. The second is running on a raspberry pi. Systemctl is not a part of freebsd. @justinsangoi @DuzAwe Could you please explain more in detail on how you solved this? I would love a short guide not that familar with this whole setup yet :)
Download the https://raw.githubusercontent.com/vmstan/gs-install/main/gs-install.sh script locally. Preferably somewhere on the array so it exists in between boots. Edit it and set CROSSCOUNT="0" to -"1". Install as the guide here shows. To run it use the gravity sync inside the .gs folder. gravity-sync/.gs/gravity-sync This was done with 4.0, not a point release no idea if it still works.
Download the https://raw.githubusercontent.com/vmstan/gs-install/main/gs-install.sh script locally. Preferably somewhere on the array so it exists in between boots. Edit it and set PHFAILCOUNT="0" to -"1". Install as the guide here shows. To run it use the gravity sync inside the .gs folder. gravity-sync/.gs/gravity-sync This was done with 4.0, not a point release no idea if it still works.
I am not following sorry :( The guide here just show to run a curl script so even if I wget that script and change it it will still give the same error. I was looking for a bit more comprehensible help here. I guess I will just have to wait for the container and maybe I can figure it out then
wget https://raw.githubusercontent.com/vmstan/gs-install/main/gs-install.sh script nano gs-install.sh Edit it and set CROSSCOUNT="0" to "-1" save. chmod +x gs-install.sh ./gs-install.sh That should install it. Make sure you do it somewhere that won't get whipped by a reboot. I created a share for all my scripts in the end as it made my life easier. Once it's installed follow the set-up guide. You have to do all of this and the config in the terminal and use user scripts to automate it. I have "install location/gravity-sync/.gs/gravity-sync" run "daily"
If you are uncomfortable in the terminal or don't understand the above, I would wait for the docker option as doing this wrong can break things.
Still gives me the same error even if I change it to "1"
This is the error I see when I try to run the script:

Was unsure what you meant with the - in the start so I tried this combinations -"1", "1" and "-1". All of them give the same error as above @DuzAwe
Try crosscount="-1" and leave PHFAILCOUNt="0"
There will be a Docker version coming here soon (it technically exists I just haven't made it work as intended yet) that should probably solve a lot of these issues.
This will be amazing. How are you going with this? A lot of us are using flippinturt's docker image on unRAID for DoH with Cloudflare's DNS. Not sure if that would change anything but here it is:
https://hub.docker.com/r/flippinturt/pihole-dot-doh
https://forums.unraid.net/topic/101615-support-flippinturt-pihole-dot-doh/
I will actually be using this same image on the Pi for the same reason
A solution like this would render the ultimate synergy between unRAID and Raspberry Pi
Forgot I was subscribed to this.
@Avsynthe I've created a Docker-first alternative to Gravity Sync specifically for use with my Unraid server and a Raspberry Pi. It's not as feature-rich, but as a result has fewer system requirements: https://github.com/mattwebbio/orbital-sync
(vmstan, if you feel sharing here is poor form I'll happily delete :)
Forgot I was subscribed to this.
@Avsynthe I've created a Docker-first alternative to Gravity Sync specifically for use with my Unraid server and a Raspberry Pi. It's not as feature-rich, but as a result has fewer system requirements: https://github.com/mattwebbio/orbital-sync
(vmstan, if you feel sharing here is poor form I'll happily delete :)
Does this do two-way sync? Will I need to install the docker container on both hosts?
Does this do two-way sync? Will I need to install the docker container on both hosts?
"No" to both.
Forgot I was subscribed to this.
@Avsynthe I've created a Docker-first alternative to Gravity Sync specifically for use with my Unraid server and a Raspberry Pi. It's not as feature-rich, but as a result has fewer system requirements: https://github.com/mattwebbio/orbital-sync
(vmstan, if you feel sharing here is poor form I'll happily delete :)
Hey dude! I actually did discover that yesterday around the same time I posted this. My question is, does Orbital monitor for real time changes and trigger from that, and when the updated pi hole "restarts" every time, is that a full container restart?
And this runs in docker right? How do I go about setting this up in Unraid without a CA template?
Cheers
Hey dude! I actually did discover that yesterday around the same time I posted this. My question is, does Orbital monitor for real time changes and trigger from that, and when the updated pi hole "restarts" every time, is that a full container restart?
And this runs in docker right? How do I go about setting this up in Unraid without a CA template?
Orbital Sync does not monitor for changes, it just performs a "backup" of the primary Pi-hole at a scheduled interval and then "restores" that backup to any number of secondary Pi-holes. As a result, the container doesn't need to be restarted - the Pi-hole web interface already handles the import.
It does run in Docker, though I have not thought about setting up a CA template. I've never created a CA template before so I'd be happy if someone else wanted to do it. Without a CA, you have to create a "new container" with the image listed in the repo description and then configure it by setting a few environment variables.
I'd be happy to be more specific if you need, but in an effort not to totally pollute this GitHub issue lets move this conversation over to the Orbital Sync discussions if you'd like me to go into more detail 😄