We use ACL's instead for this, through hooks:
===
def parse_hook(ec):
  if ec.name == 'VASP' or ec.name == 'VASP-data' or ec.name == 'ORCA':
    ec.log.info("[parse hook] Enforcing umask 007")
    os.umask(int('007', 8))
    update_build_option('umask', '007')

def post_install_hook(self, *args, **kwargs):
    if self.name == 'VASP' or self.name == 'VASP-data':
self.log.info("[post-install hook] Set ACL on installed files and the bin dir")
        majv = self.version.split('.')[0]
        cmd = ' '.join([
            'nfs4_setfacl',
            '-a',
            'A:g:[email protected]:RX' % majv,
            os.path.dirname(self.installdir),
        ])
        run_cmd(cmd, log_all=True, simple=True)
        cmd = ' '.join([
            'nfs4_setfacl',
            '-R',
            '-a',
            'A:g:[email protected]:RX' % majv,
            self.installdir,
        ])
        run_cmd(cmd, log_all=True, simple=True)

def post_module_hook(self, *args, **kwargs):
    if self.name == 'VASP' or self.name == 'VASP-data':
self.log.info("[post-module hook] Set ACL on module file and its dir")
        majv = self.version.split('.')[0]
        path_list = [os.path.dirname(self.mod_filepath), self.mod_filepath]
        cmd = ' '.join([
            'nfs4_setfacl',
            '-a',
            'A:g:[email protected]:RX' % majv,
        ] + path_list)
        run_cmd(cmd, log_all=True, simple=True)
===

On 4/25/22 20:52, Glenn (Gedaliah) Wolosh wrote:
Hi Davide,

I was thinking of something like this. Would you mind sharing a modulefile with this group restriction?



--
Ake Sandgren, HPC2N, Umea University, S-90187 Umea, Sweden
Internet: [email protected]  Mobile: +46 70 7716134  Fax: +46 90-580 14
WWW: http://www.hpc2n.umu.se

Reply via email to