gravity-sync icon indicating copy to clipboard operation
gravity-sync copied to clipboard

Systemctl not detected on this system (Unraid)

Open DuzAwe opened this issue 3 years ago • 23 comments

Quite simple Unraid does not have systemctl. Is there a workaround for this requirement?

DuzAwe avatar Apr 20 '22 21:04 DuzAwe

its also failing to detect the docker install on unraid

DuzAwe avatar Apr 20 '22 22:04 DuzAwe

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.

vmstan avatar Apr 20 '22 22:04 vmstan

Are you running the official Docker image from the Pi-hole team?

vmstan avatar Apr 20 '22 22:04 vmstan

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 avatar Apr 21 '22 08:04 DuzAwe

@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.

justinsangoi avatar Apr 21 '22 13:04 justinsangoi

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.

vmstan avatar Apr 21 '22 13:04 vmstan

@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 avatar Apr 21 '22 13:04 DuzAwe

@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 avatar Apr 21 '22 13:04 justinsangoi

@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

DuzAwe avatar Apr 21 '22 14:04 DuzAwe

Oh you have to reverse that rsync command first.

Then the command is run on array start up

DuzAwe avatar Apr 21 '22 14:04 DuzAwe

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.

justinsangoi avatar Apr 21 '22 16:04 justinsangoi

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 :)

AquaRelliux avatar Jun 18 '22 22:06 AquaRelliux

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.

DuzAwe avatar Jun 19 '22 09:06 DuzAwe

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

AquaRelliux avatar Jun 19 '22 12:06 AquaRelliux

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.

DuzAwe avatar Jun 19 '22 12:06 DuzAwe

Still gives me the same error even if I change it to "1" image This is the error I see when I try to run the script: image

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

AquaRelliux avatar Jun 20 '22 12:06 AquaRelliux

Try crosscount="-1" and leave PHFAILCOUNt="0"

DuzAwe avatar Jun 20 '22 13:06 DuzAwe

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

Avsynthe avatar Sep 28 '22 05:09 Avsynthe

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 :)

mattwebbio avatar Sep 28 '22 07:09 mattwebbio

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?

bobokun avatar Sep 28 '22 12:09 bobokun

Does this do two-way sync? Will I need to install the docker container on both hosts?

"No" to both.

mattwebbio avatar Sep 28 '22 14:09 mattwebbio

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

Avsynthe avatar Sep 28 '22 20:09 Avsynthe

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 😄

mattwebbio avatar Sep 29 '22 16:09 mattwebbio