auanasgheps / snapraid-aio-script

The definitive all-in-one SnapRAID script on Linux. Diff, sync, scrub are things of the past. Manage SnapRAID and much, much more!
GNU General Public License v3.0
225 stars 36 forks source link

Can't manage local Docker and remote Docker at the same time #83

Closed supermarkert closed 3 months ago

supermarkert commented 4 months ago

In my AIO script, I've enabled both DOCKER_REMOTE=1 and DOCKER_MODE=1 (along with appropriate SERVICES=). In this setup, the script only pauses the Remote services.

If I use only DOCKER_MODE=1, the script works fine and all my local docker containers are paused. If I then add DOCKER_REMOTE=1, this mode also works but then it only pauses the remote containers. It skips over the previously setup local docker services.

The relevant part of my config script is:

# DOCKER CONTAINERS MANAGEMENT ###

# Set to 1 to manage docker containers. They will be paused/stopped or # resumed/restarted accordingly. If set to 0, all other options related to Docker # will be ignored. MANAGE_SERVICES=1

# Choose how to manage your containers: 1 to pause/unpause, 2 to stop/restart # This option does not have any effect if MANAGE_SERVICES is set to 0 DOCKER_MODE=1

# Containers to manage (separated with spaces). Please ensure these containers # are always running before executing the script, otherwise an error will be logged. SERVICES='overseerr radarr sonarr sabnzbd'

# Manage docker containers running on a remote machine. To use this feature, # you must setup passwordless ssh access between snapRAID host and Docker host. # Set to 1 to enable, then enter Docker host SSH user and machine IP or hostname. # You can manage multiple remote Docker hosts. # Please note: for this configuration DO NOT separate containers with spaces. # Use a comma instead. # Delay is the number of seconds to wait before sending the next docker # command to avoid errors. Change it if you're experiencing errors. DOCKER_REMOTE=1 DOCKER_USER="user" DOCKER_HOST_SERVICES=('frigate.lan:frigate') DOCKER_DELAY=10

And the resulting log (see that it only paused the Remote service):

Preprocessing Healthchecks.io notification is enabled. Notifications sent to https://hc-ping.com/. Configuration file found. Checking if all parity and content files are present. All parity files found. All content files found. Docker containers management is enabled.

Pausing Containers [Tue Feb 27 10:26:58 EST 2024] Pausing Container - Frigate frigate

Processing...

tehniemer commented 4 months ago

That is odd, can you give the dev branch a try and see if that works?

supermarkert commented 4 months ago

OK, I will if I get a chance, but in the meantime I've just re-organized and now put all services under "DOCKER_REMOTE", even the services running on the same machine (so I have 2 hosts: one is the remote one and the other is the same host the script is running from). After some trial and error, it's working. But this only works because I was able to make the same username on both machines.

auanasgheps commented 3 months ago

Closing since no feedback.