Change path /var/lib/gladysassistant

Hello,

Allow changing the destination “/var/lib/gladysassistant” used to store all Gladys data. This also involves modifying the startup of the Docker containers such as Node-RED and Mosquitto.

This provides more flexibility if you want to use another partition or a disk to store the data and is cleaner than a symbolic link.

Thanks in advance.

You can already change the folder during installation by modifying the docker command.

This is already explained in the docs

Below is the folder selection in the docker command

-v /var/lib/gladysassistant:/var/lib/gladysassistant \

-v /var/lib/gladysassistant : The destination folder where Gladys will store all its data. You can change the part on the left of the « : » to modify the destination folder.

As a reminder:

The following Docker command:

-v /var/lib/gladysassistant:/var/lib/gladysassistant

is a volume mount option which means:

-v or --volume

This option allows you to mount a folder from the host system into a Docker container.

General format

-v \u003cdossier_hôte\u003e:\u003cdossier_conteneur\u003e
  • Host folder : /var/lib/gladysassistant

  • Folder in the container : /var/lib/gladysassistant

:right_arrow: This means the Docker container will use the host system folder as internal storage.

You can thus put for example:

-v /home/user_name/gladys:/var/lib/gladysassistant \

Ok for Gladys, but for Node-Red. This path cannot be changed because it is in the code and I can’t find a way to modify it in the settings.

Or maybe when Gladys installs the Node-Red Docker, it uses the path given when launching the Gladys Docker, but I highly doubt it.

Node-Red resumes the Gladys path

Hi @ArMour85,

I just went to read the Node-RED integration code and normally the path used is indeed the same path as on Gladys, so it already works without modifications!

(The code in question: Gladys/server/services/node-red/lib/installContainer.js at master · GladysAssistant/Gladys · GitHub )

So @_Will_71’s message is therefore correct!

Hello @pierre-gilles,

Yes I confirm after testing that it works fine. It’s just that I didn’t know that if Gladys starts the container, it will rely on the volume pointed to by the Gladys container.

I’m learning something new every day :wink:

We can close this request then.

1 Like