Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Persistent Files Confusion #4

Open
macedd opened this issue Sep 28, 2022 · 2 comments
Open

Persistent Files Confusion #4

macedd opened this issue Sep 28, 2022 · 2 comments

Comments

@macedd
Copy link

macedd commented Sep 28, 2022

Hi, I'm trying to generate a custom image but the persistent files look confusing to me.

I see during build it does backup a selection of files in the container.
rootfs/usr/local/hstc/install/add-default-persistent-files.sh

After that during the boot there is another operation that updates more files persistence.
rootfs/etc/my_init.d/10_updates.sh

I'm confused about how that works specially in regard the /conf persistent volume.
Can you give us some details about the purpose and operation?

By the way, many thanks for sharing the build environment.

@macedd
Copy link
Author

macedd commented Sep 29, 2022

My question is because I want to include new rootfs/ files and I'm not certain what the update procedure will look like.
Specifically, the case when new builds are just adjusting configuration files and not releasing new versions of Hestia.

@jhmaverick
Copy link
Owner

Hi,

The persistent file system exists so that it is not necessary to apply a volume to each location that needs to be keeped. As you may have noticed, there are two directories for these files, /conf which will be a volume and /conf-start which is always renewed along with the image.

The script rootfs/usr/local/hstc/install/make-persistent.sh is responsible for configure the locations in these directories, what it does is:

  1. Move the desired location to the /conf-start directory;
  2. Add a symbolic link where the file was, but directed to /conf.

When the container is run for the first time, the rootfs/etc/my_init.d/05_init.sh script will copy everything from the /conf-start directory to the /conf directory. This process is done so that access to the files in the image's /conf directory is not lost when a directory is applied as a volume.

The script rootfs/usr/local/hstc/install/add-default-persistent-files.sh is used to configure a list of important locations using make-persistent.sh and can be overridden by adding more locations if needed .

Once the /conf directory has been started your files will not be affected when recreating the container, but during an upgrade you may need some parts of these files to be updated like NGINX templates, settings... and that's what the script rootfs/etc/my_init.d/10_updates.sh is used.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants