Hi Cormac,

On 19 Dec 2013, at 23:56, Garvey, Cormac T wrote:

> 
> Hi All,
> In some of my own customized easyblocks, I need to set some group permissions 
> to control access, I
> wrote my own code to do this not aware there is an easyconfig "group" option.
> 
> When I tried the "group" easyconfig option, I got the following error.
> 
> 
> == creating build dir, resetting environment...
> Traceback (most recent call last):
>  File 
> "/hpc-common/software/easybuild/1.9.0/gcc/opt/lib/python2.7/site-packages/easybuild/main.py",
>  line 1264, in <module>
>    main()
>  File 
> "/hpc-common/software/easybuild/1.9.0/gcc/opt/lib/python2.7/site-packages/easybuild/main.py",
>  line 333, in main
>    (success, _) = build_and_install_software(spec, options, orig_environ, 
> silent=testing)
>  File 
> "/hpc-common/software/easybuild/1.9.0/gcc/opt/lib/python2.7/site-packages/easybuild/main.py",
>  line 766, in build_and_install_software
>    regtest_online=options.regtest_online)
>  File 
> "/hpc-common/software/easybuild/1.9.0/gcc/opt/lib/python2.7/site-packages/easybuild/framework/easyblock.py",
>  line 1765, in run_all_steps
>    self.run_step(stop_name, step_methods, skippable=skippable)
>  File 
> "/hpc-common/software/easybuild/1.9.0/gcc/opt/lib/python2.7/site-packages/easybuild/framework/easyblock.py",
>  line 1648, in run_step
>    m(self)
>  File 
> "/hpc-common/software/easybuild/1.9.0/gcc/opt/lib/python2.7/site-packages/easybuild/framework/easyblock.py",
>  line 1665, in <lambda>
>    (False, lambda x: x.check_readiness_step()),
>  File 
> "/hpc-common/software/easybuild/1.9.0/gcc/opt/lib/python2.7/site-packages/easybuild/framework/easyblock.py",
>  line 1131, in check_readiness_step
>    os.setgid(gid)
> OSError: [Errno 1] Operation not permitted
> 
> I guess I need to execute easybuild as root to change the group id for the 
> running process? Is there an easy way around this?
> I would prefer to install easybuild (and use group) as my own uid and not as 
> root.


No, executing as root is not the answer here ('eb' won't even allow you to, it 
check for uid 0).

I've found that the install user (i.e. the one running eb) must be a member of 
the group you're installing the software for (makes sense),
and you usually need to run "newgrp <group>" before you start 'eb', which will 
start a new shell session.

I'm not sure whether or not this can be handled in EB itself (the newgrp part).
EasyBuild does a 'os.setgid(<group id>)' as you can tell from the error 
message, but this only works when you're already actively in the group...


regards,

Kenneth

Reply via email to