Help configuring a variant symlink

I’m trying to configure a variant symlink Creating a Repository (Stratum 0) — CernVM-FS 2.9.4 documentation, but I must be doing something wrong as I cannot seem to get it working.

In the server, I have run the following during a transaction

ln -s '$(CVMFS_ML_ENV:-/cvmfs/' /cvmfs/

In a client I want to override the default link, so I put the following in a “.local” file:

# cat /etc/cvmfs/config.d/

CVMFS is aware of this variable:

# cvmfs_config showconfig | grep -i ml_env
CVMFS_ML_ENV=/cvmfs/    # from /etc/cvmfs/config.d/

But despite this, the symlink is always to the default value.

# ls -ltr /cvmfs/ 
lrwxrwxrwx 1 cvmfs cvmfs 55 May  6 12:09 /cvmfs/ -> /cvmfs/

Am I doing something wrong?

Hi Angel,

no this looks good. You might just need to do a cvmfs_config reload
It’s admittedly a bit confusing that showconfig shows the current state of the config files, not of the repository. You would need to look at the process environment in /proc for that.
Let me know if this was it!

( Note that for this reason variant symlinks aren’t often used for configuring software stacks installed on CVMFS, this is usually done via module files or setup scripts. It’s mostly used for extended CVMFS configuration, as in the example in the docs)

Ah, perfect. Wtith the cvmfs_config reload all was good (I had thought that the configuration changes would be loaded automatically, as when I change the repository contents, but it is no issue to do the “reload”, since this will seldom change.

In my case I wanted to try the variant symlinks for the following scenario (let me know if you think another approach would be more suitable):

I have some software that depends on the GPU of the client (basically I have a version that is OK for almost all clients, but some older machines need another version), so I just prepared two versions, which are loaded in each client with the same module (for example, module load ml_py310). With the variant symlink I can make the modulefile for “ml_py310” point to the correct modulefile for the client.